Skip to content
Snippets Groups Projects
Commit bdb03b82 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Check/report remove() failures

CID 319028
parent 5e485170
Branches
Tags
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -374,7 +374,8 @@ int main(int argc, char** argv)
if(length <= sizeof(fpkthdr_t) + sizeof(uint16_t) // no messages
|| length == ftell(fp)) {
puts("All good.");
remove(good_fname);
if(remove(good_fname) != 0)
fprintf(stderr, "!ERROR %d removing %s\n", errno, good_fname);
}
}
if(bad != NULL) {
......@@ -384,7 +385,8 @@ int main(int argc, char** argv)
if(length <= sizeof(fpkthdr_t) + sizeof(uint16_t) // no messages
|| length == ftell(fp)) {
puts("All bad.");
remove(bad_fname);
if(remove(bad_fname) != 0)
fprintf(stderr, "!ERROR %d removing %s\n", errno, bad_fname);
}
}
fclose(fp);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment