lib/, src/: getlong(): Use the usual -1 as an error code
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Serge Hallyn
parent
173231a8ff
commit
2d581cb337
+6
-6
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user