aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-09-05 17:57:29 -0700
committerGuy Harris <guy@alum.mit.edu>2016-09-06 00:58:02 +0000
commit4adf7f2be5b9132a0aef3e8f8f57ed525cff2e8e (patch)
tree71ec5e896a63f6ae4864b69bee41ec738157c9a9
parentc02865d3feba49bf6aaa9ce7190883c2f11e5631 (diff)
Use get_positive_int() to parse signed positive arguments.
Change-Id: I323b2c203b49a6921251583772bdb3c3afacd31b Reviewed-on: https://code.wireshark.org/review/17510 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--dumpcap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 67110e758a..591bea19f8 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -3688,7 +3688,7 @@ set_80211_channel(const char *iface, const char *opt)
for (args = 0; options[args]; args++);
if (options[0])
- freq = atoi(options[0]);
+ freq = get_positive_int(options[0], "802.11 channel frequency");
if (args >= 1 && options[1]) {
type = ws80211_str_to_chan_type(options[1]);
@@ -3700,10 +3700,10 @@ set_80211_channel(const char *iface, const char *opt)
}
if (args >= 2 && options[2])
- center_freq1 = atoi(options[2]);
+ center_freq1 = get_positive_int(options[2], "VHT center frequency");
if (args >= 3 && options[3])
- center_freq2 = atoi(options[3]);
+ center_freq2 = get_positive_int(options[3], "VHT center frequency 2");
ret = ws80211_init();
if (ret) {