diff options
author | jmallett <jmallett@FreeBSD.org> | 2004-03-15 03:41:07 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2004-03-15 03:41:07 +0000 |
commit | c228ea938aa1a06faa10191af849f0164a7e2273 (patch) | |
tree | 964807dd14349bd68967bd43125e654b50dd5131 /sbin | |
parent | 420f21f752c85ffc1575a260ab601a99287ce6a1 (diff) | |
download | FreeBSD-src-c228ea938aa1a06faa10191af849f0164a7e2273.zip FreeBSD-src-c228ea938aa1a06faa10191af849f0164a7e2273.tar.gz |
Validate argument to -i.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/kldstat/kldstat.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/kldstat/kldstat.c b/sbin/kldstat/kldstat.c index d72e972..957a2a2 100644 --- a/sbin/kldstat/kldstat.c +++ b/sbin/kldstat/kldstat.c @@ -91,11 +91,14 @@ main(int argc, char** argv) int verbose = 0; int fileid = 0; char* filename = NULL; + char* p; while ((c = getopt(argc, argv, "i:n:v")) != -1) switch (c) { case 'i': - fileid = atoi(optarg); + fileid = (int)strtoul(optarg, &p, 10); + if (*p != '\0') + usage(); break; case 'n': filename = optarg; |