From 17f09e2cea4dda0f54841f7a273e347b53f4996e Mon Sep 17 00:00:00 2001 From: Laslo Hunhold Date: Thu, 13 Apr 2017 00:07:10 +0200 Subject: Use fshut() to properly flush the output stream For small images, it could happen that the output stream would not be flushed before exit(), resulting in a lack of error-reporting on a full device. Using fflush(), a function I first introduced in sbase, we do the flushing before returning manually and report errors if they occurred. --- png2ff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'png2ff.c') diff --git a/png2ff.c b/png2ff.c index dd9073c..d76d707 100644 --- a/png2ff.c +++ b/png2ff.c @@ -107,5 +107,5 @@ main(int argc, char *argv[]) /* clean up */ png_destroy_read_struct(&pngs, &pngi, NULL); - return 0; + return fshut(stdout, ""); } -- cgit v1.2.3