mirror of
https://github.com/nmap/nmap.git
synced 2025-12-20 14:39:02 +00:00
Applied a patch by Kris Katterjohn which makes 14 functions static
This commit is contained in:
62
output.cc
62
output.cc
@@ -156,6 +156,37 @@ static void skid_output(char *s)
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove all "\nSF:" from fingerprints */
|
||||
static char* xml_sf_convert (const char* str) {
|
||||
char *temp = (char *) safe_malloc(strlen(str) + 1);
|
||||
char *dst = temp, *src = (char *)str;
|
||||
char *ampptr = 0;
|
||||
int charcount = 0;
|
||||
|
||||
while(*src && charcount < 2035) { /* 2048 - 14 */
|
||||
if (strncmp(src, "\nSF:", 4) == 0) {
|
||||
src += 4;
|
||||
continue;
|
||||
}
|
||||
/* Needed so "&something;" is not truncated midway */
|
||||
if (*src == '&') {
|
||||
ampptr = dst;
|
||||
}
|
||||
else if (*src == ';') {
|
||||
ampptr = 0;
|
||||
}
|
||||
*dst++ = *src++;
|
||||
charcount++;
|
||||
}
|
||||
if (ampptr != 0) {
|
||||
*ampptr = '\0';
|
||||
}
|
||||
else {
|
||||
*dst = '\0';
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
||||
// Creates an XML <service> element for the information given in
|
||||
// serviceDeduction. It will be 0-length if none is neccessary.
|
||||
@@ -749,37 +780,6 @@ void log_vwrite(int logt, const char *fmt, va_list ap) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Remove all "\nSF:" from fingerprints */
|
||||
char* xml_sf_convert (const char* str) {
|
||||
char *temp = (char *) safe_malloc(strlen(str) + 1);
|
||||
char *dst = temp, *src = (char *)str;
|
||||
char *ampptr = 0;
|
||||
int charcount = 0;
|
||||
|
||||
while(*src && charcount < 2035) { /* 2048 - 14 */
|
||||
if (strncmp(src, "\nSF:", 4) == 0) {
|
||||
src += 4;
|
||||
continue;
|
||||
}
|
||||
/* Needed so "&something;" is not truncated midway */
|
||||
if (*src == '&') {
|
||||
ampptr = dst;
|
||||
}
|
||||
else if (*src == ';') {
|
||||
ampptr = 0;
|
||||
}
|
||||
*dst++ = *src++;
|
||||
charcount++;
|
||||
}
|
||||
if (ampptr != 0) {
|
||||
*ampptr = '\0';
|
||||
}
|
||||
else {
|
||||
*dst = '\0';
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
|
||||
/* Write some information (printf style args) to the given log stream(s).
|
||||
Remember to watch out for format string bugs. */
|
||||
void log_write(int logt, const char *fmt, ...)
|
||||
|
||||
Reference in New Issue
Block a user