adding get_int_value() function for parsing parameters

This commit is contained in:
Richard Garnier 2016-09-20 11:13:37 +09:00
parent 114881bc9a
commit 8226747791

View File

@ -878,6 +878,13 @@ static const struct myoption admin_long_options[] = {
{ NULL, no_argument, NULL, 0 }
};
static int get_int_value(const char* s, int default_value)
{
if (!s || !(s[0]))
return default_value;
return atoi(s);
}
static int get_bool_value(const char* s)
{
if(!s || !(s[0])) return 1;