From: erg Date: Mon, 16 Nov 2009 20:38:05 +0000 (+0000) Subject: Fixes for bug 1816 X-Git-Tag: LAST_LIBGRAPH~32^2~1564 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fa3a66b3111906784f55214a2010c04e99f4ab3a;p=graphviz Fixes for bug 1816 --- diff --git a/lib/common/mpgen.c b/lib/common/mpgen.c index 9e4474c99..93a7303de 100644 --- a/lib/common/mpgen.c +++ b/lib/common/mpgen.c @@ -87,6 +87,7 @@ static void mp_cat_libfile(FILE * ofp, const char **arglib, const char **stdlib) while ((bp = Fgets(fp))) fputs(bp, ofp); fputc('\n', ofp); /* append a newline just in case */ + fclose (fp); } else agerr(AGWARN, "can't open library file %s\n", p); } diff --git a/lib/common/psusershape.c b/lib/common/psusershape.c index 3a57431bd..4096f7ada 100644 --- a/lib/common/psusershape.c +++ b/lib/common/psusershape.c @@ -88,14 +88,14 @@ static usershape_t *user_init(const char *str) fseek(fp, 0, SEEK_SET); rc = fread(contents, statbuf.st_size, 1, fp); contents[statbuf.st_size] = '\0'; - fclose(fp); dtinsert(EPSF_contents, us); us->must_inline = must_inline; - return us; } else { agerr(AGWARN, "BoundingBox not found in epsf file %s\n", str); - return NULL; + us = NULL; } + fclose(fp); + return us; } void epsf_init(node_t * n) @@ -167,6 +167,7 @@ void cat_libfile(GVJ_t * job, const char **arglib, const char **stdlib) while ((bp = Fgets(fp))) gvputs(job, bp); gvputs(job, "\n"); /* append a newline just in case */ + fclose (fp); } else agerr(AGWARN, "can't open library file %s\n", p); } diff --git a/lib/common/utils.c b/lib/common/utils.c index 33ca9a192..df6fa902c 100644 --- a/lib/common/utils.c +++ b/lib/common/utils.c @@ -1846,6 +1846,7 @@ void fix_fc(void) if((fp = fopen("fix-fc.exe", "r")) == NULL) return ; + fclose (fp); if (!system ("fix-fc.exe")) { system ("del fix_fc.exe"); system ("dot -c"); //run dot -c once too since we already run things :)