Commit bdb03b82 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Check/report remove() failures

CID 319028
parent 5e485170
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment