lib/, src/: getlong(): Use the usual -1 as an error code

Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar
2023-12-01 20:23:48 +01:00
committed by Serge Hallyn
parent 173231a8ff
commit 2d581cb337
14 changed files with 56 additions and 58 deletions
+2 -2
View File
@@ -412,7 +412,7 @@ static void get_defaults (void)
* Default Password Inactive value
*/
else if (MATCH (buf, DINACT)) {
if ( (getlong (cp, &def_inactive) == 0)
if ( (getlong(cp, &def_inactive) == -1)
|| (def_inactive < -1)) {
fprintf (stderr,
_("%s: invalid numeric argument '%s'\n"),
@@ -1315,7 +1315,7 @@ static void process_flags (int argc, char **argv)
eflg = true;
break;
case 'f':
if ( (getlong (optarg, &def_inactive) == 0)
if ( (getlong(optarg, &def_inactive) == -1)
|| (def_inactive < -1)) {
fprintf (stderr,
_("%s: invalid numeric argument '%s'\n"),