summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-08-31 17:16:07 -0700
committerGuy Harris <guy@alum.mit.edu>2015-08-31 17:16:07 -0700
commit7f3d84de1debf4982944953defefc2f1d604b288 (patch)
treea28c2ebd08f14a58bf0989df1ade158dcd40465c
parent486704db7c840dcfb51f70f1812d9c3ad37ad39c (diff)
downloadtcpdump-7f3d84de1debf4982944953defefc2f1d604b288.tar.gz
Keep the two line numbers in esp_print_decode_onesecret() separate.
Have the line number for the file we're opening for "file" be separate from the line number we're passed. That avoids warnings, and makes it clearer *which* line number we're using.
-rw-r--r--print-esp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/print-esp.c b/print-esp.c
index bcd6094d..5dbb28d4 100644
--- a/print-esp.c
+++ b/print-esp.c
@@ -432,7 +432,7 @@ static void esp_print_decode_onesecret(netdissect_options *ndo, char *line,
/* open file and read it */
FILE *secretfile;
char fileline[1024];
- int lineno=0;
+ int subfile_lineno=0;
char *nl;
char *filename = line;
@@ -443,7 +443,7 @@ static void esp_print_decode_onesecret(netdissect_options *ndo, char *line,
}
while (fgets(fileline, sizeof(fileline)-1, secretfile) != NULL) {
- lineno++;
+ subfile_lineno++;
/* remove newline from the line */
nl = strchr(fileline, '\n');
if (nl)
@@ -451,7 +451,7 @@ static void esp_print_decode_onesecret(netdissect_options *ndo, char *line,
if (fileline[0] == '#') continue;
if (fileline[0] == '\0') continue;
- esp_print_decode_onesecret(ndo, fileline, filename, lineno);
+ esp_print_decode_onesecret(ndo, fileline, filename, subfile_lineno);
}
fclose(secretfile);