OSDN Git Service

* libc/machine/mips/strlen.c (strlen) [__mips16]: Fix off-by-two
authoraoliva <aoliva>
Thu, 14 Mar 2002 02:41:42 +0000 (02:41 +0000)
committeraoliva <aoliva>
Thu, 14 Mar 2002 02:41:42 +0000 (02:41 +0000)
error.

newlib/ChangeLog
newlib/libc/machine/mips/strlen.c

index e29da53..02409c5 100644 (file)
@@ -1,3 +1,8 @@
+2002-03-13  Alexandre Oliva  <aoliva@redhat.com>
+
+       * libc/machine/mips/strlen.c (strlen) [__mips16]: Fix off-by-two
+       error.
+
 2002-03-12  Jeff Johnston  <jjohnstn@redhat.com>
 
         * libc/sys/go32/access.c: Change license to relaxed license
index f936039..158fb9f 100644 (file)
@@ -2,7 +2,7 @@
  * strlen.c -- strlen function.  On at least some MIPS chips, a simple
  * strlen is faster than the 'optimized' C version.
  *
- * Copyright (c) 2001 Red Hat, Inc.
+ * Copyright (c) 2001, 2002 Red Hat, Inc.
  *
  * The authors hereby grant permission to use, copy, modify, distribute,
  * and license this software and its documentation for any purpose, provided
@@ -29,7 +29,7 @@ strlen (const char *str)
   while (*str++ != '\0')
     ;
 
-  return str - start + 1;
+  return str - start - 1;
 }
 #elif defined(__mips64)
 __asm__(""                     /* 64-bit MIPS targets */