From 7abf68b8de2209618199c596b8d4cbd996f9127f Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 24 Oct 2020 10:24:11 -0700 Subject: [PATCH] reduce the scope of a buffer in agnameof() --- lib/cgraph/id.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.40.0