From 3c8a18a93b82e9d8f78f6a69e7963ce92c5086c3 Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 2 Jul 2011 15:25:32 +0000 Subject: [PATCH] main.c, shrink scope --- src/main.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main.c b/src/main.c index 57b9e523e..7d270179e 100644 --- a/src/main.c +++ b/src/main.c @@ -1182,20 +1182,17 @@ bot: } while (optind < argc) { - char *arg; + char *arg = argv[optind++]; FILE *tp; /* Copy all the arguments into the temporary file */ - arg = argv[optind++]; tp = fopen(arg, "r"); if (!tp) { - char *lbuffer, *p; - lbuffer = getenv("NGSPICE_INPUT"); -// fprintf(stdout, "Such-Dir %s\n", lbuffer); + char *lbuffer = getenv("NGSPICE_INPUT"); if (lbuffer && *lbuffer) { - p = TMALLOC(char, strlen(lbuffer) + strlen(DIR_PATHSEP) + strlen(arg) + 1); + char *p = + TMALLOC(char, strlen(lbuffer) + strlen(DIR_PATHSEP) + strlen(arg) + 1); sprintf(p, "%s%s%s", lbuffer, DIR_PATHSEP, arg); -// fprintf(stdout, "Suchpfad %s\n", p); tp = fopen(p, "r"); tfree(p); }