diff options
| author | Cameron Katri <me@cameronkatri.com> | 2021-02-10 18:13:31 -0500 |
|---|---|---|
| committer | Cameron Katri <me@cameronkatri.com> | 2021-02-10 19:00:38 -0500 |
| commit | 9768b265bd097e561103188bb97f64ef26c6cee1 (patch) | |
| tree | d31efcee098e5f18f411f72c26782ebfe53523b5 /pw/pw_conf.c | |
| parent | ec831d9055a20b69cb9a7300990b8e4414cbd474 (diff) | |
| download | pw-darwin-9768b265bd097e561103188bb97f64ef26c6cee1.tar.gz pw-darwin-9768b265bd097e561103188bb97f64ef26c6cee1.zip | |
New Makefile, freebsd reallocarray.c, freebsd strtonum for 12/13 compat, delete tests
Diffstat (limited to 'pw/pw_conf.c')
| -rw-r--r-- | pw/pw_conf.c | 8 |
1 files changed, 6 insertions, 2 deletions
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:" |
