Commit 9f7ba0ac authored by Clément Bœsch's avatar Clément Bœsch

Merge commit 'b8cd7a3c'

* commit 'b8cd7a3c':
  dvbsub: Check for errors from system()

printf(...) replaced with fprintf(stderr, ...) for logging errors.
Merged-by: 's avatarClément Bœsch <u@pkh.me>
parents 5403069a b8cd7a3c
......@@ -85,10 +85,16 @@ static void png_save(const char *filename, uint32_t *bitmap, int w, int h)
fclose(f);
snprintf(command, sizeof(command), "pnmtopng -alpha %s %s > %s.png 2> /dev/null", fname2, fname, filename);
system(command);
if (system(command) != 0) {
fprintf(stderr, "Error running pnmtopng\n");
return;
}
snprintf(command, sizeof(command), "rm %s %s", fname, fname2);
system(command);
if (system(command) != 0) {
fprintf(stderr, "Error removing %s and %s\n", fname, fname2);
return;
}
}
#endif
......
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