summaryrefslogtreecommitdiffstats
path: root/src/intrf.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2018-03-17 17:29:28 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2018-03-17 17:29:28 +0100
commit09ecae700f224a23cfd8f63f98cebeccbe768cc0 (patch)
tree83fbfb551cc9330a02dfb6762e2c4b8e6015eecb /src/intrf.c
parent331f0ef77e62140d0ee9252c33b23b383aa73084 (diff)
Use new functions check_command(), skip_comma_in_command() and get_int_from_command() to parse command line arguments
Diffstat (limited to 'src/intrf.c')
-rw-r--r--src/intrf.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/intrf.c b/src/intrf.c
index fe5e822..3905015 100644
--- a/src/intrf.c
+++ b/src/intrf.c
@@ -214,11 +214,8 @@ uint64_t ask_number_cli(char **current_cmd, const uint64_t val_cur, const uint64
if(*current_cmd!=NULL)
{
uint64_t tmp_val;
- while(*current_cmd[0]==',')
- (*current_cmd)++;
- tmp_val = atouint64(*current_cmd);
- while(*current_cmd[0]!=',' && *current_cmd[0]!='\0')
- (*current_cmd)++;
+ skip_comma_in_command(current_cmd);
+ tmp_val = get_int_from_command(current_cmd);
if (val_min==val_max || (tmp_val >= val_min && tmp_val <= val_max))
return tmp_val;
else