Fix off-by-one bug in tst-fwrite-error
authorSiddhesh Poyarekar <siddhesh@redhat.com>
Mon, 15 Apr 2013 06:05:43 +0000 (11:35 +0530)
committerSiddhesh Poyarekar <siddhesh@redhat.com>
Mon, 15 Apr 2013 06:05:43 +0000 (11:35 +0530)
tst-fwrite-error did not allocate enough space for the string 'world'
and its NULL terminator.  Fixed.

ChangeLog
libio/tst-fwrite-error.c

index b80865e..ac1d263 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2013-04-15  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
+       * libio/tst-fwrite-error.c (do_test): Fix BUF array definition.
+
        * benchtests/Rules (bench-deps): Collect dependencies into a
        single variable.  Add Makefile to dependencies.
        ($(objpfx)bench-%.c): Depend on bench-deps.
index e2507ef..87c8766 100644 (file)
@@ -36,7 +36,7 @@ do_test (void)
       return 1;
     }
 
-  char buf[5] = "world";
+  char buf[] = "world";
   setvbuf (fp, NULL, _IONBF, 0);
   close (fd);
   unlink (tmpl);