]> granicus.if.org Git - graphviz/commitdiff
gvconfig: move declaration of 'tmp' var local to #if <platform> blocks
authorNehal J Wani <nehaljw.kkd1@gmail.com>
Sun, 17 Oct 2021 12:25:46 +0000 (08:25 -0400)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 2 Nov 2021 02:51:47 +0000 (19:51 -0700)
lib/gvc/gvconfig.c

index 06c332670f01d65ce7626219c7a517303fbde83d..6f6f49562860d73a516c7f1e2a9c0a4c5750899f 100644 (file)
@@ -263,7 +263,6 @@ char * gvconfig_libdir(GVC_t * gvc)
     static char line[BSZ];
     static char *libdir;
     static boolean dirShown = 0; 
-    char *tmp;
 
     if (!libdir) {
         libdir=getenv("GVBINDIR");
@@ -297,7 +296,7 @@ char * gvconfig_libdir(GVC_t * gvc)
            const char* path;
            for (i = 0; i < c; ++i) {
                path = _dyld_get_image_name(i);
-               tmp = strstr(path, "/libgvc.");
+               const char* tmp = strstr(path, "/libgvc.");
                if (tmp) {
                    if (tmp > path) {
                        /* Check for real /lib dir. Don't accept pre-install /.libs */
@@ -332,7 +331,7 @@ char * gvconfig_libdir(GVC_t * gvc)
                    path = strchr (line, '/');
                    if (!path)
                        continue;
-                   tmp = strstr (path, "/libgvc.");
+                   char* tmp = strstr (path, "/libgvc.");
                    if (tmp) {
                        *tmp = 0;
                        /* Check for real /lib dir. Don't accept pre-install /.libs */