summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-01-15 18:18:24 +0100
committerSerge Hallyn <serge@hallyn.com>2024-03-14 17:11:36 -0500
commit93151689c0d81b3428572d411e551fff7330db07 (patch)
tree8f4495ec212fbf18ab5a80931ed811326d25a9e5
parentae17e0291d313e08a2a3071083a8e2b5a4a362b2 (diff)
lib/sgetspent.c: sgetspent(): Use NULL instead of 0 to mean a null pointer constant
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--lib/sgetspent.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/sgetspent.c b/lib/sgetspent.c
index 07104924..0ac1edd6 100644
--- a/lib/sgetspent.c
+++ b/lib/sgetspent.c
@@ -14,6 +14,7 @@
#ident "$Id$"
+#include <stddef.h>
#include <stdio.h>
#include <sys/types.h>
#include <string.h>
@@ -48,7 +49,7 @@ sgetspent(const char *string)
fprintf (shadow_logfd,
"%s: Too long passwd entry encountered, file corruption?\n",
shadow_progname);
- return 0; /* fail if too long */
+ return NULL; /* fail if too long */
}
strcpy (spwbuf, string);
@@ -78,7 +79,7 @@ sgetspent(const char *string)
if ( ((NULL != cp) && ('\0' != *cp)) ||
((i != FIELDS) && (i != OFIELDS)) ) {
- return 0;
+ return NULL;
}
/*
@@ -99,7 +100,7 @@ sgetspent(const char *string)
spwd.sp_lstchg = -1;
} else if ( (getlong(fields[2], &spwd.sp_lstchg) == -1)
|| (spwd.sp_lstchg < 0)) {
- return 0;
+ return NULL;
}
/*
@@ -110,7 +111,7 @@ sgetspent(const char *string)
spwd.sp_min = -1;
} else if ( (getlong(fields[3], &spwd.sp_min) == -1)
|| (spwd.sp_min < 0)) {
- return 0;
+ return NULL;
}
/*
@@ -121,7 +122,7 @@ sgetspent(const char *string)
spwd.sp_max = -1;
} else if ( (getlong(fields[4], &spwd.sp_max) == -1)
|| (spwd.sp_max < 0)) {
- return 0;
+ return NULL;
}
/*
@@ -146,7 +147,7 @@ sgetspent(const char *string)
spwd.sp_warn = -1;
} else if ( (getlong(fields[5], &spwd.sp_warn) == -1)
|| (spwd.sp_warn < 0)) {
- return 0;
+ return NULL;
}
/*
@@ -158,7 +159,7 @@ sgetspent(const char *string)
spwd.sp_inact = -1;
} else if ( (getlong(fields[6], &spwd.sp_inact) == -1)
|| (spwd.sp_inact < 0)) {
- return 0;
+ return NULL;
}
/*
@@ -170,7 +171,7 @@ sgetspent(const char *string)
spwd.sp_expire = -1;
} else if ( (getlong(fields[7], &spwd.sp_expire) == -1)
|| (spwd.sp_expire < 0)) {
- return 0;
+ return NULL;
}
/*
@@ -181,7 +182,7 @@ sgetspent(const char *string)
if (fields[8][0] == '\0') {
spwd.sp_flag = SHADOW_SP_FLAG_UNSET;
} else if (getulong(fields[8], &spwd.sp_flag) == -1) {
- return 0;
+ return NULL;
}
return (&spwd);
@@ -189,4 +190,3 @@ sgetspent(const char *string)
#else
extern int ISO_C_forbids_an_empty_translation_unit;
#endif
-