#endif /* ACCT_TOOLS_SETUID */
#include <pwd.h>
-#include "atoi/str2i.h"
+#include "atoi/a2i.h"
#include "defines.h"
#include "memzero.h"
#include "prototypes.h"
SNPRINTF(buf, "%ld", mindays);
change_field (buf, sizeof buf, _("Minimum Password Age"));
- if ( (str2sl(&mindays, buf) == -1)
- || (mindays < -1)) {
+ if (a2sl(&mindays, buf, NULL, 0, -1, LONG_MAX) == -1)
return 0;
- }
SNPRINTF(buf, "%ld", maxdays);
change_field (buf, sizeof buf, _("Maximum Password Age"));
- if ( (str2sl(&maxdays, buf) == -1)
- || (maxdays < -1)) {
+ if (a2sl(&maxdays, buf, NULL, 0, -1, LONG_MAX) == -1)
return 0;
- }
if (-1 == lstchgdate || lstchgdate > LONG_MAX / DAY)
strcpy(buf, "-1");
SNPRINTF(buf, "%ld", warndays);
change_field (buf, sizeof buf, _("Password Expiration Warning"));
- if ( (str2sl(&warndays, buf) == -1)
- || (warndays < -1)) {
+ if (a2sl(&warndays, buf, NULL, 0, -1, LONG_MAX) == -1)
return 0;
- }
SNPRINTF(buf, "%ld", inactdays);
change_field (buf, sizeof buf, _("Password Inactive"));
- if ( (str2sl(&inactdays, buf) == -1)
- || (inactdays < -1)) {
+ if (a2sl(&inactdays, buf, NULL, 0, -1, LONG_MAX) == -1)
return 0;
- }
if (-1 == expdate || LONG_MAX / DAY < expdate)
strcpy(buf, "-1");
break;
case 'I':
Iflg = true;
- if ( (str2sl(&inactdays, optarg) == -1)
- || (inactdays < -1)) {
+ if (a2sl(&inactdays, optarg, NULL, 0, -1, LONG_MAX) == -1) {
fprintf (stderr,
_("%s: invalid numeric argument '%s'\n"),
Prog, optarg);
break;
case 'm':
mflg = true;
- if ( (str2sl(&mindays, optarg) == -1)
- || (mindays < -1)) {
+ if (a2sl(&mindays, optarg, NULL, 0, -1, LONG_MAX) == -1) {
fprintf (stderr,
_("%s: invalid numeric argument '%s'\n"),
Prog, optarg);
break;
case 'M':
Mflg = true;
- if ( (str2sl(&maxdays, optarg) == -1)
- || (maxdays < -1)) {
+ if (a2sl(&maxdays, optarg, NULL, 0, -1, LONG_MAX) == -1) {
fprintf (stderr,
_("%s: invalid numeric argument '%s'\n"),
Prog, optarg);
break;
case 'W':
Wflg = true;
- if ( (str2sl(&warndays, optarg) == -1)
- || (warndays < -1)) {
+ if (a2sl(&warndays, optarg, NULL, 0, -1, LONG_MAX) == -1) {
fprintf (stderr,
_("%s: invalid numeric argument '%s'\n"),
Prog, optarg);