diff options
Diffstat (limited to 'vtep')
-rw-r--r-- | vtep/vtep-ctl.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/vtep/vtep-ctl.c b/vtep/vtep-ctl.c index 35ab43588..fb3c81e2b 100644 --- a/vtep/vtep-ctl.c +++ b/vtep/vtep-ctl.c @@ -65,7 +65,7 @@ static bool oneline; static bool dry_run; /* --timeout: Time to wait for a connection to 'db'. */ -static int timeout; +static unsigned int timeout; /* Format for table output. */ static struct table_style table_style = TABLE_STYLE_DEFAULT; @@ -252,10 +252,8 @@ parse_options(int argc, char *argv[], struct shash *local_options) exit(EXIT_SUCCESS); case 't': - timeout = strtoul(optarg, NULL, 10); - if (timeout < 0) { - ctl_fatal("value %s on -t or --timeout is invalid", - optarg); + if (!str_to_uint(optarg, 10, &timeout) || !timeout) { + ctl_fatal("value %s on -t or --timeout is invalid", optarg); } break; |