diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-06-08 19:48:57 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-06-08 19:48:57 +0000 |
commit | 1899d502b989476279392c9466872c58a23e8bfe (patch) | |
tree | b5931bb8971c62ed6b3a4a20f076d887886ad381 | |
parent | f5cec9c9a052fad58a4a5fb05c366af2474a695a (diff) |
use endptr in a strtl()
-rw-r--r-- | usr.bin/ftp/cmds.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/ftp/cmds.c b/usr.bin/ftp/cmds.c index 6524c49a3f5..c3bb0ecec55 100644 --- a/usr.bin/ftp/cmds.c +++ b/usr.bin/ftp/cmds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmds.c,v 1.27 1998/06/08 16:55:56 millert Exp $ */ +/* $OpenBSD: cmds.c,v 1.28 1998/06/08 19:48:56 millert Exp $ */ /* $NetBSD: cmds.c,v 1.27 1997/08/18 10:20:15 lukem Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)cmds.c 8.6 (Berkeley) 10/9/94"; #else -static char rcsid[] = "$OpenBSD: cmds.c,v 1.27 1998/06/08 16:55:56 millert Exp $"; +static char rcsid[] = "$OpenBSD: cmds.c,v 1.28 1998/06/08 19:48:56 millert Exp $"; #endif #endif /* not lint */ @@ -779,8 +779,11 @@ sethash(argc, argv) else if (strcasecmp(argv[1], "off") == 0) hash = 0; else { - long nmark = strtol(argv[1], NULL, 10); - if (nmark < 1 && nmark > INT_MAX) { + long nmark; + char *ep; + + nmark = strtol(argv[1], &ep, 10); + if (nmark < 1 || nmark > INT_MAX || *ep != '\0') { fprintf(ttyout, "%s: bad bytecount value.\n", argv[1]); code = -1; return; |