From: Matthew Fernandez Date: Sat, 24 Oct 2020 17:24:11 +0000 (-0700) Subject: reduce the scope of a buffer in agnameof() X-Git-Tag: 2.46.0~20^2^2~4^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7abf68b8de2209618199c596b8d4cbd996f9127f;p=graphviz reduce the scope of a buffer in agnameof() --- diff --git a/lib/cgraph/id.c b/lib/cgraph/id.c index 9146177ee..a03cec5f6 100644 --- a/lib/cgraph/id.c +++ b/lib/cgraph/id.c @@ -139,7 +139,6 @@ char *agnameof(void *obj) { Agraph_t *g; char *rv; - static char buf[32]; /* perform internal lookup first */ g = agraphof(obj); @@ -152,6 +151,7 @@ char *agnameof(void *obj) return rv; } if (AGTYPE(obj) != AGEDGE) { + static char buf[32]; sprintf(buf, "%c%ld", LOCALNAMEPREFIX, AGID(obj)); rv = buf; }