Fix off-by-one bug in tst-fwrite-error

tst-fwrite-error did not allocate enough space for the string 'world'
and its NULL terminator.  Fixed.
This commit is contained in:
Siddhesh Poyarekar 2013-04-15 11:35:43 +05:30
parent acb4325fc7
commit 5cb26d0aed
2 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
2013-04-15 Siddhesh Poyarekar <siddhesh@redhat.com> 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 * benchtests/Rules (bench-deps): Collect dependencies into a
single variable. Add Makefile to dependencies. single variable. Add Makefile to dependencies.
($(objpfx)bench-%.c): Depend on bench-deps. ($(objpfx)bench-%.c): Depend on bench-deps.

View File

@ -36,7 +36,7 @@ do_test (void)
return 1; return 1;
} }
char buf[5] = "world"; char buf[] = "world";
setvbuf (fp, NULL, _IONBF, 0); setvbuf (fp, NULL, _IONBF, 0);
close (fd); close (fd);
unlink (tmpl); unlink (tmpl);