#include <fcntl.h>
#include <limits.h>
#include <signal.h>
+#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
if (NULL == buf)
goto cleanup_errno;
- while (db->ops->cio_fgets(buf, buflen, db->fp) == buf) {
+ while (db->ops->cio_fgets(buf, buflen, db->fp) != NULL) {
struct commonio_entry *p;
while ( (strrchr (buf, '\n') == NULL)
#include "fields.h"
#include <ctype.h>
-#include <string.h>
+#include <stddef.h>
#include <stdio.h>
+#include <string.h>
#include "prototypes.h"
#include "string/ctype/strisascii/strisprint.h"
printf ("\t%s [%s]: ", prompt, buf);
(void) fflush (stdout);
- if (fgets (newf, maxsize, stdin) != newf) {
+ if (fgets(newf, maxsize, stdin) == NULL)
return;
- }
if (stpsep(newf, "\n") == NULL)
return;
#include "config.h"
+#include <stddef.h>
#include <stdio.h>
#include <string.h>
char *ep;
while (cnt > 0) {
- if (fgets (cp, cnt, f) != cp) {
+ if (fgets(cp, cnt, f) == NULL) {
if (cp == buf) {
return NULL;
} else {
#ident "$Id$"
#include <pwd.h>
+#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
if (NULL == fp) {
return false;
}
- for (found = false; !found && (fgets(buf, sizeof(buf), fp) == buf);) {
+ for (found = false; !found && (fgets(buf, sizeof(buf), fp) != NULL);) {
stpsep(buf, "\n");
found = streq(buf, pw->pw_shell) ||
streq(buf, pw->pw_name);
#ident "$Id$"
#include <assert.h>
-#include <stdio.h>
#include <signal.h>
+#include <stddef.h>
+#include <stdio.h>
#include "attr.h"
#include "defines.h"
*/
memzero_a(buf);
- if (fgets(buf, sizeof(buf), stdin) != buf) {
+ if (fgets(buf, sizeof(buf), stdin) == NULL)
exit (EXIT_FAILURE);
- }
if (stpsep(buf, "\n") == NULL)
exit(EXIT_FAILURE);
#ident "$Id$"
#include <assert.h>
+#include <stddef.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
if (NULL == fp) {
return;
}
- while (fgets(buf, sizeof(buf), fp) == buf) {
+ while (fgets(buf, sizeof(buf), fp) != NULL) {
if (stpsep(buf, "\n") == NULL)
break;
buflen *= 2;
len = strlen (buf);
- if (fgetsx(&buf[len], buflen - len, fp) != &buf[len]) {
+ if (fgetsx(&buf[len], buflen - len, fp) == NULL)
return NULL;
- }
}
stpsep(buf, "\n");
return sgetsgent(buf);
#ident "$Id$"
+#include <stddef.h>
#include <stdio.h>
#include <string.h>
perror (typefile);
return;
}
- while (fgets(buf, sizeof(buf), fp) == buf) {
+ while (fgets(buf, sizeof(buf), fp) != NULL) {
if (strprefix(buf, "#")) {
continue;
}
#ident "$Id: $"
#include <assert.h>
+#include <stddef.h>
#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>
if (NULL == sfile) {
return 0;
}
- while (fgets(line, sizeof(line), sfile) == line) {
+ while (fgets(line, sizeof(line), sfile) != NULL) {
if (strprefix(line, "Uid:\t")) {
unsigned long ruid, euid, suid;
if (NULL != fp) {
intmax_t lineno = 0; /* for diagnostics */
while ( !match
- && (fgets(line, sizeof(line), fp) == line))
+ && (fgets(line, sizeof(line), fp) != NULL))
{
char *p;
#include <getopt.h>
#include <grp.h>
#ifdef ENABLE_LASTLOG
-#include <lastlog.h>
+# include <lastlog.h>
#endif /* ENABLE_LASTLOG */
#include <libgen.h>
#include <pwd.h>
#include <signal.h>
#ifdef ACCT_TOOLS_SETUID
-#ifdef USE_PAM
-#include "pam_defs.h"
-#endif /* USE_PAM */
+# ifdef USE_PAM
+# include "pam_defs.h"
+# endif /* USE_PAM */
#endif /* ACCT_TOOLS_SETUID */
#include <paths.h>
+#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
* Read the file a line at a time. Only the lines that have relevant
* values are used, everything else can be ignored.
*/
- while (fgets(buf, sizeof(buf), fp) == buf) {
+ while (fgets(buf, sizeof(buf), fp) != NULL) {
stpsep(buf, "\n");
cp = stpsep(buf, "=");
goto skip;
}
- while (fgets(buf, sizeof(buf), ifp) == buf) {
+ while (fgets(buf, sizeof(buf), ifp) != NULL) {
char *val;
if (stpsep(buf, "\n") == NULL) {