1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-10 09:49:05 +00:00

Nmap 4.02Alpha1 release for Everdream

This commit is contained in:
fyodor
2006-03-03 23:12:14 +00:00
parent bd46c3ae39
commit 848ad2a96a
19 changed files with 164 additions and 116 deletions

View File

@@ -197,15 +197,13 @@ char *strerror(int errnum) {
/* Like the perl equivialent -- It removes the terminating newline from string
IF one exists. It then returns the POSSIBLY MODIFIED string */
char *chomp(char *string) {
int len;
len = strlen(string);
if (len < 1)
return string;
if (string[len - 1] != '\n')
return string;
if (len > 1 && string[len-2] == '\r') {
string[len-2] = '\0';
} else string[len-1] = '\0';
int len = strlen(string);
if (len && string[len - 1] == '\n') {
if (len > 1 && string[len - 2] == '\r')
string[len - 2] = '\0';
else
string[len - 1] = '\0';
}
return string;
}