From 5b7dc00335f81d96ba5e44d5cd10c4f4ed5371ba Mon Sep 17 00:00:00 2001 From: zhenwei pi Date: Mon, 6 Jan 2020 10:00:37 +0800 Subject: [PATCH] Exit program when invalid TTL option Suggested by Jim, tcpping should exit when user input an invalid ttl. Signed-off-by: zhenwei pi --- tcpping.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tcpping.c b/tcpping.c index dd2d3e1..12e5b39 100644 --- a/tcpping.c +++ b/tcpping.c @@ -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':