about summary refs log tree commit diff
path: root/wcsmbs
diff options
context:
space:
mode:
Diffstat (limited to 'wcsmbs')
-rw-r--r--wcsmbs/tst-wcpncpy.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/wcsmbs/tst-wcpncpy.c b/wcsmbs/tst-wcpncpy.c
index 26eeff9485..76d5fd3fd7 100644
--- a/wcsmbs/tst-wcpncpy.c
+++ b/wcsmbs/tst-wcpncpy.c
@@ -27,7 +27,7 @@ main (void)
   int result = 0;
 
   const wchar_t src[] = L"0";
-  wchar_t dest[10];
+  wchar_t dest[21];
   wmemset (dest, L'\0', 10);
   wchar_t *endp = wcpncpy (dest, src, 2);
   if (wcscmp (dest, src) != 0)
@@ -65,5 +65,13 @@ main (void)
       puts ("return value of long string call incorrect");
     }
 
+  const wchar_t src5[] = L"ab";
+  endp = wcpncpy (dest, src5, 20);
+  if (endp != dest + 2)
+    {
+      result = 1;
+      puts ("return value of large limit call incorrect");
+    }
+
   return result;
 }