commit dcf3e2a3e5e43dfabcf16523cfafcf0c9dc5e2fd
parent 52a44f3afc6ec4a267e5c2f8956dc79bc4556c64
Author: aabacchus <ben@bvnf.space>
Date: Tue, 14 Sep 2021 17:29:36 +0100
shred: remove unused buf
should have been removed in bb78561
Diffstat:
1 file changed, 0 insertions(+), 3 deletions(-)
diff --git a/src/shred.c b/src/shred.c
@@ -21,15 +21,12 @@ fill_with_zeroes(const char *filename)
return 1;
}
long int bytes_to_write = stat_struct.st_size;
- char *buf = NULL;
- buf = malloc(bytes_to_write);
for(int i = 0; i < bytes_to_write; i++)
if(write(fd, "\0\0\0\0\0", bytes_to_write + 2048) == -1) {
fprintf(stderr, "shred: %s: %s\n", filename, strerror(errno));
return 1;
}
- free(buf);
return 0;
}