From: Matthew Fernandez Date: Sat, 24 Oct 2020 17:13:04 +0000 (-0700) Subject: reduce the scope of buffer in write_nodename() X-Git-Tag: 2.46.0~20^2^2~4^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a34de1c6ace0e8a71a657aea23a36e0862d2d2b;p=graphviz reduce the scope of buffer in write_nodename() --- diff --git a/lib/cgraph/write.c b/lib/cgraph/write.c index caa12db3f..0f432c980 100644 --- a/lib/cgraph/write.c +++ b/lib/cgraph/write.c @@ -497,7 +497,7 @@ static int write_nondefault_attrs(void *obj, iochan_t * ofile, static int write_nodename(Agnode_t * n, iochan_t * ofile) { - char *name, buf[sizeof("__SUSPECT") + 20]; + char *name; Agraph_t *g; name = agnameof(n); @@ -505,6 +505,7 @@ static int write_nodename(Agnode_t * n, iochan_t * ofile) if (name) { CHKRV(write_canonstr(g, ofile, name)); } else { + char buf[sizeof("__SUSPECT") + 20]; sprintf(buf, "_%ld_SUSPECT", AGID(n)); /* could be deadly wrong */ CHKRV(ioput(g, ofile, buf)); }