diff --git a/src/cfg.c b/src/cfg.c index a199a07..48f8253 100644 --- a/src/cfg.c +++ b/src/cfg.c @@ -341,7 +341,7 @@ cfg_set_server_port(const char *port_str, const char **errstrp) return (-1); } - port = strtonum(port_str, 1, UINT16_MAX, &errstr); + port = (unsigned int)strtonum(port_str, 1, UINT16_MAX, &errstr); if (errstr) { if (errstrp) *errstrp = errstr; diff --git a/src/cfg_private.h b/src/cfg_private.h index 2baf657..fe6ca97 100644 --- a/src/cfg_private.h +++ b/src/cfg_private.h @@ -141,7 +141,7 @@ struct cfg { return (-1); \ } \ \ - num = strtonum((s), 0, UINT_MAX, &errstr); \ + num = (unsigned int)strtonum((s), 0, UINT_MAX, &errstr); \ if (errstr) { \ if ((e)) \ *(e) = errstr; \ @@ -160,7 +160,7 @@ struct cfg { return (-1); \ } \ \ - num = strtonum((s), INT_MIN, INT_MAX, &errstr); \ + num = (int)strtonum((s), INT_MIN, INT_MAX, &errstr); \ if (errstr) { \ if ((e)) \ *(e) = errstr; \