From: Nehal J Wani Date: Sun, 17 Oct 2021 12:25:46 +0000 (-0400) Subject: gvconfig: move declaration of 'tmp' var local to #if blocks X-Git-Tag: 2.50.0~54^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=284df35236e258a49b86fad6f0d062bf0c2fa840;p=graphviz gvconfig: move declaration of 'tmp' var local to #if blocks --- diff --git a/lib/gvc/gvconfig.c b/lib/gvc/gvconfig.c index 06c332670..6f6f49562 100644 --- a/lib/gvc/gvconfig.c +++ b/lib/gvc/gvconfig.c @@ -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 */