From: discomfitor Date: Sat, 31 Jul 2010 05:24:47 +0000 (+0000) Subject: verify that fopen succeeded X-Git-Tag: submit/2.0alpha-wayland/20121127.221958~1184 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0c55ccc66bd28d519c2f456e4434573ba7c2b2e7;p=profile%2Fivi%2Fedje.git verify that fopen succeeded git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@50709 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/bin/edje_decc.c b/src/bin/edje_decc.c index a9c06b5..08870ec 100644 --- a/src/bin/edje_decc.c +++ b/src/bin/edje_decc.c @@ -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); } }