Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2006-12-04 20:29:10 +0300
committerJeff Johnston <jjohnstn@redhat.com>2006-12-04 20:29:10 +0300
commit489bb390ceff00454f0f904c8c96cd39405918c6 (patch)
tree772109c661eb69e3807c35ea9ebfa152c1060d1c /newlib
parent3e2d7a911f66c4c274035daaae8295225c7a7065 (diff)
2006-12-04 Kazunori Asayama <asayama@sm.sony.co.jp>
* libc/machine/spu/strncpy.c: Add padding.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/ChangeLog4
-rw-r--r--newlib/libc/machine/spu/strncpy.c5
2 files changed, 9 insertions, 0 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 119c0a6be..4be46540d 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,5 +1,9 @@
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:
2006-12-01 Kazunori Asayama <asayama@sm.sony.co.jp>
diff --git a/newlib/libc/machine/spu/strncpy.c b/newlib/libc/machine/spu/strncpy.c
index 5e6169f32..334c3bb6c 100644
--- a/newlib/libc/machine/spu/strncpy.c
+++ b/newlib/libc/machine/spu/strncpy.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));