avoid trying to fwrite to an unopened file
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Sat, 15 Jan 2011 19:53:11 +0000 (19:53 +0000)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Sat, 15 Jan 2011 19:53:11 +0000 (19:53 +0000)
SVN revision: 56140

legacy/edje/src/bin/edje_decc.c

index 31036ed..5735afc 100644 (file)
@@ -319,7 +319,10 @@ output(void)
                       exit (-1);
                    }
                  if (!(f = fopen(out, "wb")))
-                    ERR("Could not open file: %s", out);
+                    {
+                       ERR("Could not open file: %s", out);
+                      exit (-1);
+                    }
                  if (fwrite(font, fontsize, 1, f) != 1)
                    ERR("Could not write font: %s", strerror(errno));
                  if (f) fclose(f);