diff options
author | tedu <tedu@openbsd.org> | 2014-02-13 21:07:42 +0000 |
---|---|---|
committer | tedu <tedu@openbsd.org> | 2014-02-13 21:07:42 +0000 |
commit | a362fec478dd32ccf2fc740b8ae8d3d51c027188 (patch) | |
tree | f35f461362b986228316854989554c472ea929f7 /usr.sbin/procmap | |
parent | atoi -> strtonum (diff) | |
download | wireguard-openbsd-a362fec478dd32ccf2fc740b8ae8d3d51c027188.tar.xz wireguard-openbsd-a362fec478dd32ccf2fc740b8ae8d3d51c027188.zip |
use strtonum
Diffstat (limited to 'usr.sbin/procmap')
-rw-r--r-- | usr.sbin/procmap/procmap.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/procmap/procmap.c b/usr.sbin/procmap/procmap.c index e331f761433..c85998b9c78 100644 --- a/usr.sbin/procmap/procmap.c +++ b/usr.sbin/procmap/procmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procmap.c,v 1.50 2013/08/12 05:41:01 otto Exp $ */ +/* $OpenBSD: procmap.c,v 1.51 2014/02/13 21:07:42 tedu Exp $ */ /* $NetBSD: pmap.c,v 1.1 2002/09/01 20:32:44 atatat Exp $ */ /* @@ -197,6 +197,7 @@ RB_GENERATE(uvm_map_addr, vm_map_entry, daddrs.addr_entry, no_impl); int main(int argc, char *argv[]) { + const char *errstr; char errbuf[_POSIX2_LINE_MAX], *kmem = NULL, *kernel = NULL; struct kinfo_proc *kproc; struct sum total_sum; @@ -217,7 +218,9 @@ main(int argc, char *argv[]) print_ddb = 1; break; case 'D': - debug = atoi(optarg); + debug = strtonum(optarg, 0, 0xf, &errstr); + if (errstr) + errx(1, "invalid debug mask"); break; case 'l': print_maps = 1; |