2006-12-04 Kazunori Asayama <asayama@sm.sony.co.jp>
* libc/machine/spu/strncpy.c: Add padding.
This commit is contained in:
parent
3e2d7a911f
commit
489bb390ce
|
@ -1,3 +1,7 @@
|
|||
2006-12-04 Kazunori Asayama <asayama@sm.sony.co.jp>
|
||||
|
||||
* libc/machine/spu/strncpy.c: Add padding.
|
||||
|
||||
2006-12-04 Kazunori Asayama <asayama@sm.sony.co.jp>
|
||||
|
||||
* testsuite/newlib.string/tstring.c:
|
||||
|
|
|
@ -76,6 +76,11 @@ char * strncpy(char * __restrict__ dest, const char * __restrict__ src, size_t n
|
|||
*/
|
||||
len = spu_extract(spu_sel(spu_promote((unsigned int)len, 0), N, gt), 0);
|
||||
|
||||
/* Padding
|
||||
*/
|
||||
if (len != n) {
|
||||
memset(dest + len, 0, n - len);
|
||||
}
|
||||
/* Perform a memcpy of the resulting length
|
||||
*/
|
||||
return ((char *)memcpy((void *)dest, (const void *)src, len));
|
||||
|
|
Loading…
Reference in New Issue