From 9768b265bd097e561103188bb97f64ef26c6cee1 Mon Sep 17 00:00:00 2001 From: Cameron Katri Date: Wed, 10 Feb 2021 18:13:31 -0500 Subject: New Makefile, freebsd reallocarray.c, freebsd strtonum for 12/13 compat, delete tests --- pw/pw_conf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'pw/pw_conf.c') diff --git a/pw/pw_conf.c b/pw/pw_conf.c index c446a66..1e35240 100644 --- a/pw/pw_conf.c +++ b/pw/pw_conf.c @@ -41,6 +41,10 @@ static const char rcsid[] = #include "pw.h" +long long +freebsdstrtonum(const char *numstr, long long minval, long long maxval, + const char **errstrp); + #define debugging 0 enum { @@ -380,7 +384,7 @@ read_userconfig(char const * file) break; case _UC_EXPIRE: if ((q = unquote(q)) != NULL) { - config.expire_days = strtonum(q, 0, + config.expire_days = freebsdstrtonum(q, 0, INT_MAX, &errstr); if (errstr) warnx("Invalid expire days:" @@ -389,7 +393,7 @@ read_userconfig(char const * file) break; case _UC_PASSWORD: if ((q = unquote(q)) != NULL) { - config.password_days = strtonum(q, 0, + config.password_days = freebsdstrtonum(q, 0, INT_MAX, &errstr); if (errstr) warnx("Invalid password days:" -- cgit v1.2.3