verify that fopen succeeded
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 31 Jul 2010 05:24:47 +0000 (05:24 +0000)
committerdiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 31 Jul 2010 05:24:47 +0000 (05:24 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@50709 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/edje_decc.c

index a9c06b5..08870ec 100644 (file)
@@ -314,10 +314,11 @@ output(void)
                       ERR("Potential security violation. attempt to write in parent dir.");
                       exit (-1);
                    }
-                 f = fopen(out, "wb");
+                 if (!(f = fopen(out, "wb")))
+                    ERR("Could not open file: %s", out);
                  if (fwrite(font, fontsize, 1, f) != 1)
                    ERR("Could not write font: %s", strerror(errno));
-                 fclose(f);
+                 if (f) fclose(f);
                  free(font);
               }
          }