/
niceSOFT
/
valgrind
Обзор
Документация
Войти
/
niceSOFT
/
valgrind
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
memcheck/tests/fwrite.c
17 строк
311 B
Tom Hughes
Fixed test to not assume that malloc(10) will return 10 nul bytes!
01 ноя 2005, 20:21
01 ноя 2005, 20:21
030b1aa
Код
Авторство
О чём код?
#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; }