1
0
mirror of https://github.com/ioacademy-jikim/debugging synced 2025-06-29 10:46:14 +00:00
2015-12-13 22:34:58 +09: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;
}