Skip to content

Commit

Permalink
check optarg for -h more precisely
Browse files Browse the repository at this point in the history
  • Loading branch information
itojun committed Nov 9, 2001
1 parent 5c4d952 commit 6d3bd76
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kame/kame/ping6/ping6.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $KAME: ping6.c,v 1.141 2001/11/09 06:58:41 itojun Exp $ */
/* $KAME: ping6.c,v 1.142 2001/11/09 07:04:14 itojun Exp $ */

/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
Expand Down Expand Up @@ -411,6 +411,8 @@ main(argc, argv)
break;
case 'h': /* hoplimit */
hoplimit = strtol(optarg, &e, 10);
if (*optarg == '\0' || *e != '\0')
errx(1, "illegal hoplimit %s", optarg);
if (255 < hoplimit || hoplimit < -1)
errx(1,
"illegal hoplimit -- %s", optarg);
Expand Down

0 comments on commit 6d3bd76

Please sign in to comment.