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
+6 -6
View File
@@ -166,7 +166,7 @@ static struct spwd *my_sgetspent (const char *string)
if (fields[2][0] == '\0') {
spwd.sp_lstchg = -1;
} else {
if (getlong (fields[2], &spwd.sp_lstchg) == 0) {
if (getlong(fields[2], &spwd.sp_lstchg) == -1) {
#ifdef USE_NIS
if (nis_used) {
spwd.sp_lstchg = -1;
@@ -185,7 +185,7 @@ static struct spwd *my_sgetspent (const char *string)
if (fields[3][0] == '\0') {
spwd.sp_min = -1;
} else {
if (getlong (fields[3], &spwd.sp_min) == 0) {
if (getlong(fields[3], &spwd.sp_min) == -1) {
#ifdef USE_NIS
if (nis_used) {
spwd.sp_min = -1;
@@ -206,7 +206,7 @@ static struct spwd *my_sgetspent (const char *string)
if (fields[4][0] == '\0') {
spwd.sp_max = -1;
} else {
if (getlong (fields[4], &spwd.sp_max) == 0) {
if (getlong(fields[4], &spwd.sp_max) == -1) {
#ifdef USE_NIS
if (nis_used) {
spwd.sp_max = -1;
@@ -239,7 +239,7 @@ static struct spwd *my_sgetspent (const char *string)
if (fields[5][0] == '\0') {
spwd.sp_warn = -1;
} else {
if (getlong (fields[5], &spwd.sp_warn) == 0) {
if (getlong(fields[5], &spwd.sp_warn) == -1) {
#ifdef USE_NIS
if (nis_used) {
spwd.sp_warn = -1;
@@ -261,7 +261,7 @@ static struct spwd *my_sgetspent (const char *string)
if (fields[6][0] == '\0') {
spwd.sp_inact = -1;
} else {
if (getlong (fields[6], &spwd.sp_inact) == 0) {
if (getlong(fields[6], &spwd.sp_inact) == -1) {
#ifdef USE_NIS
if (nis_used) {
spwd.sp_inact = -1;
@@ -283,7 +283,7 @@ static struct spwd *my_sgetspent (const char *string)
if (fields[7][0] == '\0') {
spwd.sp_expire = -1;
} else {
if (getlong (fields[7], &spwd.sp_expire) == 0) {
if (getlong(fields[7], &spwd.sp_expire) == -1) {
#ifdef USE_NIS
if (nis_used) {
spwd.sp_expire = -1;