From 23c214d961dbe2bcb96ac6b5784848fd9a5b0743 Mon Sep 17 00:00:00 2001 From: fyodor Date: Tue, 12 Sep 2006 07:03:35 +0000 Subject: [PATCH] bug fixing --- scripts/Makefile | 6 +++--- scripts/fingerlib.cc | 30 +++++++++++++++--------------- scripts/fingermatch.cc | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/scripts/Makefile b/scripts/Makefile index 0d6a4622e..1721fadfd 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -18,13 +18,13 @@ dummy: .cc.o: dummy $(CXX) -c $(CXXFLAGS) $(INCLUDE_FLAGS) $(DEFINES) $< -o $@ -fingerfix: dummy +fingerfix: dummy fingerlib.o $(CXX) $(CXXFLAGS) -Wall $(INCLUDE_FLAGS) $(LINK_FLAGS) $(DEFINES) -o $@ $@.cc fingerlib.o $(NMAP_OBJS) -lm -lnbase -lpcap -lpcre -lssl -lcrypt -fingermatch: dummy +fingermatch: dummy fingerlib.o $(CXX) $(CXXFLAGS) -Wall $(INCLUDE_FLAGS) $(LINK_FLAGS) $(DEFINES) -o $@ $@.cc fingerlib.o $(NMAP_OBJS) -lm -lnbase -lpcap -lpcre -lssl -lcrypt -fingerdiff: dummy +fingerdiff: dummy fingerlib.o $(CXX) $(CXXFLAGS) -Wall $(INCLUDE_FLAGS) $(LINK_FLAGS) $(DEFINES) -o $@ $@.cc fingerlib.o $(NMAP_OBJS) -lm -lnbase -lpcap -lpcre -lssl -lcrypt servicematch: dummy diff --git a/scripts/fingerlib.cc b/scripts/fingerlib.cc index 7b04e6855..9f1199974 100644 --- a/scripts/fingerlib.cc +++ b/scripts/fingerlib.cc @@ -194,25 +194,25 @@ int readFP(FILE *filep, char *FP, int FPsz ) { lineno++; linelen = strlen(line); p = line; - if (*p == '\n' || *p == '.') { + if (*p == '\n' || *p == '.') { // end of input + *dst = '\0'; if(isInWrappedFP) { - // We have just completed reading in a wrapped fp. Because a - // wrapped fp is submitted by user, so we check if there is a - // SCAN line in it. If yes, look inside the scan line. - *dst = '\0'; - checkFP(oneFP); - isInWrappedFP = false; - } + // We have just completed reading in a wrapped fp. Because a + // wrapped fp is submitted by user, so we check if there is a + // SCAN line in it. If yes, look inside the scan line. + checkFP(oneFP); + isInWrappedFP = false; + } break; } while(*p && isspace(*p)) p++; - if (*p == '#') - continue; // skip the comment line + if (*p == '#') + continue; // skip the comment line - if (dst - FP + linelen >= FPsz - 5) - fatal("[ERRO] Overflow!\n"); + if (dst - FP + linelen >= FPsz - 5) + fatal("[ERRO] Overflow!\n"); if(strncmp(p, "OS:", 3) == 0) { // the line is start with "OS:" @@ -223,9 +223,9 @@ int readFP(FILE *filep, char *FP, int FPsz ) { } p += 3; while(*p != '\r' && *p != '\n') { - *dst++ = toupper(*p); - if(*p == ')') *dst++ = '\n'; - p++; + *dst++ = toupper(*p); + if(*p == ')') *dst++ = '\n'; + p++; } continue; } diff --git a/scripts/fingermatch.cc b/scripts/fingermatch.cc index 731e78b09..3c9d08435 100644 --- a/scripts/fingermatch.cc +++ b/scripts/fingermatch.cc @@ -143,7 +143,7 @@ int main(int argc, char *argv[]) { if (!testFP) fatal("Sorry -- failed to parse the so-called fingerprint you entered"); if ((rc = remove_duplicate_tests(testFP))) { - printf("\n**WARNING**: Adjusted fingerprint due to %d duplicated tests (we only look at the first).", rc); + printf("[WARN] Adjusted fingerprint due to %d duplicated tests (we only look at the first).\n", rc); } /* Now we find the matches! */