]> Savannah Git Hosting - gnulib.git/commitdiff
strncat, wcsncat tests: Fix test.
authorBruno Haible <bruno@clisp.org>
Wed, 6 Nov 2024 11:34:18 +0000 (12:34 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 6 Nov 2024 11:34:18 +0000 (12:34 +0100)
* tests/test-strncat.c (main): Change y to a valid string.
* tests/test-wcsncat.c (main): Change y to a valid wide string.

ChangeLog
tests/test-strncat.c
tests/test-wcsncat.c

index fd4a4db56051f1e3f35dbaf05e7ae1ebb39f5a57..43e09219b3ea55c00f8ae1fe3976eac70029b739 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-11-06  Bruno Haible  <bruno@clisp.org>
+
+       strncat, wcsncat tests: Fix test.
+       * tests/test-strncat.c (main): Change y to a valid string.
+       * tests/test-wcsncat.c (main): Change y to a valid wide string.
+
 2024-11-05  Paul Eggert  <eggert@cs.ucla.edu>
 
        eealloc: deprecate
index c4668d95b4b474b5bf89309292c7743d6962fb7e..c7fe68227e3ee49c2c17d6179bdaf855029b77cf 100644 (file)
@@ -69,7 +69,7 @@ main ()
 #endif
 
   {
-    char y[1];
+    char y[2] = { 'x', '\0' };
     value = (strncat (y, NULL, 0) == y);
     ASSERT (value);
   }
index b8479dfb5eca156aac22a3a6e2a0151d4be607ef..1b838261f2b19d3eb6c9853d563528c5abbd5f03 100644 (file)
@@ -39,7 +39,7 @@ main ()
 #endif
 
   {
-    wchar_t y[1];
+    wchar_t y[2] = { L'x', 0 };
     value = (wcsncat (y, NULL, 0) == y);
     ASSERT (value);
   }