#include "defines.h"
#include "getdef.h"
+#include "io/fgets/fgets.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, countof(buf), fp) != NULL) {
+ while (fgets_a(buf, fp) != NULL) {
stpsep(buf, "\n");
if (streq(buf, tty)) {
(void) fclose (fp);
#include <string.h>
#include <sys/param.h>
+#include "io/fgets/fgets.h"
#include "prototypes.h"
-#include "sizeof.h"
#include "string/ctype/strisascii/strisprint.h"
#include "string/ctype/strchrisascii/strchriscntrl.h"
#include "string/strcmp/streq.h"
printf ("\t%s [%s]: ", prompt, buf);
(void) fflush (stdout);
- if (fgets(newf, countof(newf), stdin) == NULL)
+ if (fgets_a(newf, stdin) == NULL)
return;
if (stpsep(newf, "\n") == NULL)
#include "atoi/a2i.h"
#include "defines.h"
#include "getdef.h"
+#include "io/fgets/fgets.h"
#include "prototypes.h"
#include "shadowlog.h"
#include "sizeof.h"
/*
* Go through all of the lines in the file.
*/
- while (fgets(buf, countof(buf), fp) != NULL) {
+ while (fgets_a(buf, fp) != NULL) {
/*
* Trim trailing whitespace.
#include "defines.h"
#include "getdef.h"
+#include "io/fgets/fgets.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, countof(buf), fp) != NULL);) {
+ for (found = false; !found && (fgets_a(buf, fp) != NULL);) {
stpsep(buf, "\n");
found = streq(buf, pw->pw_shell) ||
streq(buf, pw->pw_name);
#include <sys/resource.h>
#include "atoi/a2i.h"
-#include "sizeof.h"
+#include "io/fgets/fgets.h"
#include "string/memset/memzero.h"
#include "string/strcmp/streq.h"
#include "string/strcmp/strprefix.h"
*
* FIXME: a better (smarter) checking should be done
*/
- while (fgets(buf, countof(buf), fil) != NULL) {
+ while (fgets_a(buf, fil) != NULL) {
if (strprefix(buf, "#") || strprefix(buf, "\n")) {
continue;
}
#include "attr.h"
#include "defines.h"
#include "getdef.h"
+#include "io/fgets/fgets.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, countof(buf), stdin) == NULL)
+ if (fgets_a(buf, stdin) == NULL)
exit (EXIT_FAILURE);
if (stpsep(buf, "\n") == NULL)
#include <string.h>
#include "defines.h"
+#include "io/fgets/fgets.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, countof(buf), ports) == NULL) {
+ if (fgets_a(buf, ports) == NULL) {
errno = saveerr;
return NULL;
}
#include "config.h"
+#include <ctype.h>
+#include <pwd.h>
#include <stddef.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
-#include <ctype.h>
#include "prototypes.h"
#include "defines.h"
-#include <pwd.h>
#include "getdef.h"
+#include "io/fgets/fgets.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, countof(buf), fp) != NULL) {
+ while (fgets_a(buf, fp) != NULL) {
if (stpsep(buf, "\n") == NULL)
break;
#include "defines.h"
#include "getdef.h"
+#include "io/fgets/fgets.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, countof(buf), fp) != NULL) {
+ while (fgets_a(buf, fp) != NULL) {
if (strprefix(buf, "#")) {
continue;
}
#include "defines.h"
#include "getdef.h"
+#include "io/fgets/fgets.h"
#include "prototypes.h"
-#include "sizeof.h"
#include "string/strtok/stpsep.h"
fp = fopen (fname, "r");
if ( (NULL == fp)
- || (fgets(tzbuf, countof(tzbuf), fp) == NULL)) {
+ || (fgets_a(tzbuf, fp) == NULL)) {
result = "TZ=CST6CDT";
} else {
stpsep(tzbuf, "\n");
#include "atoi/getnum.h"
#include "defines.h"
#include "fs/readlink/readlinknul.h"
+#include "io/fgets/fgets.h"
#include "prototypes.h"
#ifdef ENABLE_SUBIDS
#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, countof(line), sfile) != NULL) {
+ while (fgets_a(line, sfile) != NULL) {
if (strprefix(line, "Uid:\t")) {
unsigned long ruid, euid, suid;
#endif
/*@-exitarg@*/
#include "exitcodes.h"
+#include "io/fgets/fgets.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, countof(buf), stdin) != NULL) {
+ while (fgets_a(buf, stdin) != NULL) {
line++;
if (stpsep(buf, "\n") == NULL) {
fprintf (stderr, _("%s: line %jd: line too long\n"),
#include "shadowio.h"
/*@-exitarg@*/
#include "exitcodes.h"
+#include "io/fgets/fgets.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, countof(buf), stdin) != NULL) {
+ while (fgets_a(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, countof(buf), stdin) != NULL) {
+ while (fgets_a(buf, stdin) != NULL) {
if (strchr(buf, '\n'))
break;
}
#include <unistd.h>
#include "defines.h"
+#include "io/fgets/fgets.h"
#include "prototypes.h"
#include "sizeof.h"
#include "string/strcmp/strcaseeq.h"
if (NULL != fp) {
intmax_t lineno = 0; /* for diagnostics */
while ( !match
- && (fgets(line, countof(line), fp) != NULL))
+ && (fgets_a(line, fp) != NULL))
{
char *p;
#include "defines.h"
#include "getdef.h"
#include "groupio.h"
+#include "io/fgets/fgets.h"
#include "nscd.h"
#include "prototypes.h"
#include "pwio.h"
#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, countof(buf), stdin) != NULL) {
+ while (fgets_a(buf, stdin) != NULL) {
line++;
if (stpsep(buf, "\n") == NULL && feof(stdin) == 0) {
fprintf (stderr, _("%s: line %jd: line too long\n"),
#include <sys/types.h>
#include "defines.h"
+#include "io/fgets/fgets.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, countof(temp), authfile_fd) != NULL) {
+ while (fgets_a(temp, authfile_fd) != NULL) {
char *p;
lines++;
#include "fs/mkstemp/fmkomstemp.h"
#include "getdef.h"
#include "groupio.h"
+#include "io/fgets/fgets.h"
#include "nscd.h"
#include "prototypes.h"
#include "pwauth.h"
#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, countof(buf), fp) != NULL) {
+ while (fgets_a(buf, fp) != NULL) {
stpsep(buf, "\n");
cp = stpsep(buf, "=");
goto skip;
}
- while (fgets(buf, countof(buf), ifp) != NULL) {
+ while (fgets_a(buf, ifp) != NULL) {
char *val;
if (stpsep(buf, "\n") == NULL) {