]> granicus.if.org Git - graphviz/commitdiff
reduce the scope of a buffer in agnameof()
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 24 Oct 2020 17:24:11 +0000 (10:24 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 31 Oct 2020 01:46:51 +0000 (18:46 -0700)
lib/cgraph/id.c

index 9146177ee2b3b10e5c88a0cae14ea40e145614a4..a03cec5f6a98af12d47b18cf5f7c8ab4d964b56e 100644 (file)
@@ -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;
     }