mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 12:29:32 +08:00
2008-07-17 Ken Werner <ken.werner@de.ibm.com>
* libc/machine/spu/strcpy.h: Pad null bytes if necessary.
This commit is contained in:
parent
874149c80c
commit
eb19b8f95a
@ -1,3 +1,7 @@
|
||||
2008-07-17 Ken Werner <ken.werner@de.ibm.com>
|
||||
|
||||
* libc/machine/spu/strcpy.h: Pad null bytes if necessary.
|
||||
|
||||
2008-07-08 Kenji Tanaka <tanaka.ken2@jp.panasonic.com>
|
||||
|
||||
* libc/machine/mn10300/memset.S: Fix bug where return value is
|
||||
|
@ -176,5 +176,9 @@ static inline void * _strncpy(char * __restrict__ dest, const char *
|
||||
*/
|
||||
dest[maxlen - spu_extract(curlen, 0)] = '\0';
|
||||
}
|
||||
|
||||
/* 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));
|
||||
return (dest);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user