#include "defines.h"
#include "getdef.h"
#include "prototypes.h"
+#include "sizeof.h"
#include "string/strcmp/streq.h"
#include "string/strcmp/strprefix.h"
#include "string/strcpy/strtcpy.h"
* See if this tty is listed in the console file.
*/
- while (fgets(buf, sizeof(buf), fp) != NULL) {
+ while (fgets(buf, countof(buf), fp) != NULL) {
stpsep(buf, "\n");
if (streq(buf, tty)) {
(void) fclose (fp);
/*
* Go through all of the lines in the file.
*/
- while (fgets(buf, sizeof(buf), fp) != NULL) {
+ while (fgets(buf, countof(buf), fp) != NULL) {
/*
* Trim trailing whitespace.
#include "defines.h"
#include "getdef.h"
#include "prototypes.h"
+#include "sizeof.h"
#include "string/sprintf/snprintf.h"
#include "string/strcmp/streq.h"
#include "string/strtok/stpsep.h"
if (NULL == fp) {
return false;
}
- for (found = false; !found && (fgets(buf, sizeof(buf), fp) != NULL);) {
+ for (found = false; !found && (fgets(buf, countof(buf), fp) != NULL);) {
stpsep(buf, "\n");
found = streq(buf, pw->pw_shell) ||
streq(buf, pw->pw_name);
#include "defines.h"
#include "getdef.h"
#include "prototypes.h"
+#include "sizeof.h"
#include "string/memset/memzero.h"
#include "string/strcpy/strtcpy.h"
#include "string/strspn/stpspn.h"
*/
memzero_a(buf);
- if (fgets(buf, sizeof(buf), stdin) == NULL)
+ if (fgets(buf, countof(buf), stdin) == NULL)
exit (EXIT_FAILURE);
if (stpsep(buf, "\n") == NULL)
#include "defines.h"
#include "port.h"
#include "prototypes.h"
+#include "sizeof.h"
#include "string/strcmp/streq.h"
#include "string/strcmp/strprefix.h"
#include "string/strtok/stpsep.h"
*/
next:
- if (fgets(buf, sizeof(buf), ports) == NULL) {
+ if (fgets(buf, countof(buf), ports) == NULL) {
errno = saveerr;
return NULL;
}
#include <pwd.h>
#include "getdef.h"
#include "shadowlog.h"
+#include "sizeof.h"
#include "string/sprintf/aprintf.h"
#include "string/strcmp/streq.h"
#include "string/strcmp/strprefix.h"
if (NULL == fp) {
return;
}
- while (fgets(buf, sizeof(buf), fp) != NULL) {
+ while (fgets(buf, countof(buf), fp) != NULL) {
if (stpsep(buf, "\n") == NULL)
break;
#include "defines.h"
#include "getdef.h"
#include "prototypes.h"
+#include "sizeof.h"
#include "string/strcmp/streq.h"
#include "string/strcmp/strprefix.h"
#include "string/strtok/stpsep.h"
perror (typefile);
return;
}
- while (fgets(buf, sizeof(buf), fp) != NULL) {
+ while (fgets(buf, countof(buf), fp) != NULL) {
if (strprefix(buf, "#")) {
continue;
}
#include "defines.h"
#include "getdef.h"
#include "prototypes.h"
+#include "sizeof.h"
#include "string/strtok/stpsep.h"
fp = fopen (fname, "r");
if ( (NULL == fp)
- || (fgets(tzbuf, sizeof(tzbuf), fp) == NULL)) {
+ || (fgets(tzbuf, countof(tzbuf), fp) == NULL)) {
result = "TZ=CST6CDT";
} else {
stpsep(tzbuf, "\n");
#include "subordinateio.h"
#endif /* ENABLE_SUBIDS */
#include "shadowlog.h"
+#include "sizeof.h"
#include "string/sprintf/snprintf.h"
#include "string/strcmp/streq.h"
#include "string/strcmp/strneq.h"
if (NULL == sfile) {
return 0;
}
- while (fgets(line, sizeof(line), sfile) != NULL) {
+ while (fgets(line, countof(line), sfile) != NULL) {
if (strprefix(line, "Uid:\t")) {
unsigned long ruid, euid, suid;
#include "exitcodes.h"
#include "shadow/gshadow/sgrp.h"
#include "shadowlog.h"
+#include "sizeof.h"
#include "string/strcmp/streq.h"
#include "string/strerrno.h"
#include "string/strtok/stpsep.h"
* group entry for each group will be looked up in the appropriate
* file (gshadow or group) and the password changed.
*/
- while (fgets(buf, sizeof(buf), stdin) != NULL) {
+ while (fgets(buf, countof(buf), stdin) != NULL) {
line++;
if (stpsep(buf, "\n") == NULL) {
fprintf (stderr, _("%s: line %jd: line too long\n"),
/*@-exitarg@*/
#include "exitcodes.h"
#include "shadowlog.h"
+#include "sizeof.h"
#include "string/strcmp/streq.h"
#include "string/strerrno.h"
#include "string/strtok/stpsep.h"
* last change date is set in the age only if aging information is
* present.
*/
- while (fgets(buf, sizeof(buf), stdin) != NULL) {
+ while (fgets(buf, countof(buf), stdin) != NULL) {
char *cp;
line++;
if (stpsep(buf, "\n") == NULL) {
if (feof (stdin) == 0) {
// Drop all remaining characters on this line.
- while (fgets(buf, sizeof(buf), stdin) != NULL) {
+ while (fgets(buf, countof(buf), stdin) != NULL) {
if (strchr(buf, '\n'))
break;
}
if (NULL != fp) {
intmax_t lineno = 0; /* for diagnostics */
while ( !match
- && (fgets(line, sizeof(line), fp) != NULL))
+ && (fgets(line, countof(line), fp) != NULL))
{
char *p;
#endif /* ENABLE_SUBIDS */
#include "shadow/gshadow/sgrp.h"
#include "shadowlog.h"
+#include "sizeof.h"
#include "sssd.h"
#include "string/sprintf/snprintf.h"
#include "string/strcmp/streq.h"
* over 100 is allocated. The pw_gid field will be updated with that
* value.
*/
- while (fgets(buf, sizeof(buf), stdin) != NULL) {
+ while (fgets(buf, countof(buf), stdin) != NULL) {
line++;
if (stpsep(buf, "\n") == NULL && feof(stdin) == 0) {
fprintf (stderr, _("%s: line %jd: line too long\n"),
#include "defines.h"
#include "prototypes.h"
+#include "sizeof.h"
#include "string/strcmp/streq.h"
#include "string/strcmp/strprefix.h"
#include "string/strspn/stpspn.h"
return DENY;
}
- while (fgets(temp, sizeof(temp), authfile_fd) != NULL) {
+ while (fgets(temp, countof(temp), authfile_fd) != NULL) {
char *p;
lines++;
#endif
#include "shadow/gshadow/sgrp.h"
#include "shadowlog.h"
+#include "sizeof.h"
#include "sssd.h"
#include "string/memset/memzero.h"
#include "string/sprintf/aprintf.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) != NULL) {
+ while (fgets(buf, countof(buf), fp) != NULL) {
stpsep(buf, "\n");
cp = stpsep(buf, "=");
goto skip;
}
- while (fgets(buf, sizeof(buf), ifp) != NULL) {
+ while (fgets(buf, countof(buf), ifp) != NULL) {
char *val;
if (stpsep(buf, "\n") == NULL) {