Skip to content

Commit d3ee0d2

Browse files
catenacyberfenner
authored andcommitted
Remove only if file is present
1 parent 2fd0bc7 commit d3ee0d2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fuzz/fuzz_pcap.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ void fuzz_openFile(const char * name) {
3737
static int bufferToFile(const char * name, const uint8_t *Data, size_t Size) {
3838
FILE * fd;
3939
if (remove(name) != 0) {
40-
printf("failed remove, errno=%d\n", errno);
41-
return -1;
40+
if (errno != ENOENT) {
41+
printf("failed remove, errno=%d\n", errno);
42+
return -1;
43+
}
4244
}
4345
fd = fopen(name, "wb");
4446
if (fd == NULL) {

0 commit comments

Comments
 (0)