Tom Hughes 030b1aac10 Fixed test to not assume that malloc(10) will return 10 nul bytes!
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4978
2005-11-01 17:21:03 +00:00

18 lines
311 B
C

#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main ( void )
{
char* arr = malloc(10);
int fd = open("/dev/null", O_WRONLY);
if (fd < 0) {
fprintf(stderr, "open failed\n");
} else {
(void)write(fd, arr, 10);
(void)close(fd);
}
return 0;
}