OSDN Git Service

2008-07-18 Ken Werner <ken.werner@de.ibm.com>
authorjjohnstn <jjohnstn>
Fri, 18 Jul 2008 16:36:21 +0000 (16:36 +0000)
committerjjohnstn <jjohnstn>
Fri, 18 Jul 2008 16:36:21 +0000 (16:36 +0000)
        * libc/machine/spu/strcpy.h: Fix error in previous patch.

newlib/ChangeLog
newlib/libc/machine/spu/strcpy.h

index 9eb10cc..88206eb 100644 (file)
@@ -1,3 +1,7 @@
+2008-07-18  Ken Werner  <ken.werner@de.ibm.com>
+
+       * libc/machine/spu/strcpy.h: Fix error in previous patch.
+
 2008-07-17  Jeff Johnston  <jjohnstn@redhat.com>
 
        * libc/include/assert.h (__ASSERT_FUNC): Define to __FUNCTION__ when
index 946148b..b407eaf 100644 (file)
@@ -178,7 +178,7 @@ static inline void * _strncpy(char * __restrict__ dest, const char *
   }
 
   /* Pad null bytes if the length of the "src" is less than "n" (strncpy).  */
-  if (checklen && !lastzero && (maxlen != spu_extract(curlen,0)))
-    memset(dest + spu_extract(curlen, 0), 0, maxlen - spu_extract(curlen, 0));
+  if (checklen && !lastzero && spu_extract(curlen, 0))
+    memset(dest + maxlen - spu_extract(curlen, 0), 0, spu_extract(curlen, 0));
   return (dest);
 }