Skip to content

Commit

Permalink
Exit program when invalid TTL option
Browse files Browse the repository at this point in the history
Suggested by Jim, tcpping should exit when user input an invalid ttl.

Signed-off-by: zhenwei pi <[email protected]>
  • Loading branch information
pizhenwei committed Jan 6, 2020
1 parent ff278c0 commit 5b7dc00
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tcpping.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@ int main(int argc, char *argv[])
ttl = atoi(optarg);
if (ttl < 1 || ttl > 255) {
fprintf(stderr, "Invalid TTL\n");
exit(1);
}
break;
case 'v':
Expand Down

0 comments on commit 5b7dc00

Please sign in to comment.