about summary refs log tree commit diff
path: root/wcsmbs/wcpncpy.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-07-22 19:23:54 +0000
committerUlrich Drepper <drepper@redhat.com>2003-07-22 19:23:54 +0000
commitbc55a0b89789624f5ed4a64d2b7e463812674776 (patch)
treecf14c8b9a2fc8b582eb8df9e76c09167a4345465 /wcsmbs/wcpncpy.c
parent7e939b219825ec15cfa45d226f910f80c9035755 (diff)
downloadglibc-bc55a0b89789624f5ed4a64d2b7e463812674776.tar.gz
glibc-bc55a0b89789624f5ed4a64d2b7e463812674776.tar.xz
glibc-bc55a0b89789624f5ed4a64d2b7e463812674776.zip
(tests): Add tst-wcpncpy.
Diffstat (limited to 'wcsmbs/wcpncpy.c')
-rw-r--r--wcsmbs/wcpncpy.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/wcsmbs/wcpncpy.c b/wcsmbs/wcpncpy.c
index df7efd7fb0..bd62e62682 100644
--- a/wcsmbs/wcpncpy.c
+++ b/wcsmbs/wcpncpy.c
@@ -31,8 +31,6 @@ __wcpncpy (dest, src, n)
   wint_t c;
   wchar_t *const s = dest;
 
-  --dest;
-
   if (n >= 4)
     {
       size_t n4 = n >> 2;
@@ -40,19 +38,19 @@ __wcpncpy (dest, src, n)
       for (;;)
 	{
 	  c = *src++;
-	  *++dest = c;
+	  *dest++ = c;
 	  if (c == L'\0')
 	    break;
 	  c = *src++;
-	  *++dest = c;
+	  *dest++ = c;
 	  if (c == L'\0')
 	    break;
 	  c = *src++;
-	  *++dest = c;
+	  *dest++ = c;
 	  if (c == L'\0')
 	    break;
 	  c = *src++;
-	  *++dest = c;
+	  *dest++ = c;
 	  if (c == L'\0')
 	    break;
 	  if (--n4 == 0)