summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--main.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/main.c b/main.c

index 7ab6ba6..2911c38 100644 --- a/main.c +++ b/main.c
@@ -317,6 +317,8 @@ static void process_line(char* line, void* cbData) return; } + + if (isdigit(line[0]) == 0) { if (print_indeterminate) @@ -332,6 +334,18 @@ static void process_line(char* line, void* cbData) } strncpy(ip, line, strcspn(line, " ")); + int ipLen = (int) strlen(ip); + for (int i = 0; i < ipLen; i++) + { + if (!isdigit(ip[i]) && ip[i] != '.') + { + if (print_indeterminate) + printf("[Indeterminate (Invalid IP)]: %s\n", line); + free(ip); + return; + } + } + // printf("meow %s\n", ip);