From 7cae42841e85cf6bfdb74d9ebe9958f350f5a4ef Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Tue, 23 Jul 2024 22:42:54 +0200 Subject: [PATCH] contrib/, lib/, src/: Consistently use sizeof() as if it were a function sizeof(foo) - No spaces. Not: sizeof (foo) - Parentheses. Not: sizeof foo - No parentheses wrapping sizeof itself Not: (sizeof foo) This patch can be approximated with the following semantic patch: $ cat ~/tmp/spatch/sizeof.sp @@ identifier a, b; @@ - sizeof a->b + sizeof(a->b) @@ identifier a, b; @@ - sizeof a.b + sizeof(a.b) @@ identifier x; @@ - sizeof x + sizeof(x) @@ identifier x; @@ - sizeof *x + sizeof(*x) @@ identifier x; @@ - (sizeof(x)) + sizeof(x) @@ identifier x; @@ - (sizeof(*x)) + sizeof(*x) Applied as $ find contrib/ lib* src/ -type f \ | xargs spatch --sp-file ~/tmp/spatch/sizeof.sp --in-place; The differences between the actual patch and the approximation via the semantic patch from above are whitespace only. When reviewing, it'll be useful to diff with '-w'. Link: Signed-off-by: Alejandro Colomar --- contrib/adduser.c | 32 ++++++++++++++++---------------- lib/addgrps.c | 2 +- lib/commonio.c | 6 +++--- lib/console.c | 2 +- lib/copydir.c | 2 +- lib/env.c | 2 +- lib/failure.c | 14 +++++++------- lib/fields.c | 4 ++-- lib/getdate.y | 2 +- lib/getdef.c | 6 +++--- lib/hushed.c | 2 +- lib/log.c | 8 ++++---- lib/loginprompt.c | 4 ++-- lib/setupenv.c | 2 +- lib/sgetpwent.c | 2 +- lib/sgetspent.c | 2 +- lib/shadow.c | 4 ++-- lib/subordinateio.c | 2 +- lib/tcbfuncs.c | 2 +- lib/ttytype.c | 2 +- lib/tz.c | 2 +- lib/user_busy.c | 8 ++++---- lib/utmp.c | 20 ++++++++++---------- src/chage.c | 14 +++++++------- src/chfn.c | 10 +++++----- src/chgpasswd.c | 2 +- src/chpasswd.c | 4 ++-- src/chsh.c | 2 +- src/faillog.c | 12 ++++++------ src/groupadd.c | 4 ++-- src/groupmod.c | 2 +- src/grpconv.c | 2 +- src/lastlog.c | 14 +++++++------- src/login.c | 4 ++-- src/login_nopam.c | 4 ++-- src/newusers.c | 2 +- src/pwconv.c | 2 +- src/suauth.c | 2 +- src/useradd.c | 24 ++++++++++++------------ src/usermod.c | 30 +++++++++++++++--------------- 40 files changed, 133 insertions(+), 133 deletions(-) diff --git a/contrib/adduser.c b/contrib/adduser.c index 5be2205a8d..a4bf426c73 100644 --- a/contrib/adduser.c +++ b/contrib/adduser.c @@ -201,7 +201,7 @@ main (void) printf ("\nLogin to add (^C to quit): "); fflush (stdout); - safeget (usrname, sizeof (usrname)); + safeget(usrname, sizeof(usrname)); if (!strlen (usrname)) { @@ -236,10 +236,10 @@ main (void) printf ("\nFull Name [%s]: ", usrname); fflush (stdout); - safeget (person, sizeof (person)); + safeget(person, sizeof(person)); if (!strlen (person)) { - bzero (person, sizeof (person)); + bzero(person, sizeof(person)); strcpy (person, usrname); }; @@ -250,7 +250,7 @@ main (void) bad = 0; printf ("GID [%d]: ", DEFAULT_GROUP); fflush (stdout); - safeget (foo, sizeof (foo)); + safeget(foo, sizeof(foo)); if (!strlen (foo)) group = DEFAULT_GROUP; else if (isdigit (*foo)) @@ -291,7 +291,7 @@ main (void) printf ("\nIf home dir ends with a / then '%s' will be appended to it\n", usrname); printf ("Home Directory [%s/%s]: ", DEFAULT_HOME, usrname); fflush (stdout); - safeget (dir, sizeof (dir)); + safeget(dir, sizeof(dir)); if (!strlen(dir)) /* hit return */ sprintf(dir, "%s/%s", DEFAULT_HOME, usrname); else if (dir[strlen (dir) - 1] == '/') @@ -305,7 +305,7 @@ main (void) printf ("\nShell [%s]: ", DEFAULT_SHELL); fflush (stdout); - safeget (shell, sizeof (shell)); + safeget(shell, sizeof(shell)); if (!strlen (shell)) strcpy(shell, DEFAULT_SHELL); else @@ -337,7 +337,7 @@ main (void) #endif printf ("\nMin. Password Change Days [%d]: ", DEFAULT_MIN_PASS); fflush (stdout); - safeget (foo, sizeof (foo)); + safeget(foo, sizeof(foo)); if (strlen (foo) > 1) min_pass = DEFAULT_MIN_PASS; else @@ -345,7 +345,7 @@ main (void) printf ("Max. Password Change Days [%d]: ", DEFAULT_MAX_PASS); fflush (stdout); - safeget (foo, sizeof (foo)); + safeget(foo, sizeof(foo)); if (strlen (foo) > 1) max_pass = atoi (foo); else @@ -353,7 +353,7 @@ main (void) printf ("Password Warning Days [%d]: ", DEFAULT_WARN_PASS); fflush (stdout); - safeget (foo, sizeof (foo)); + safeget(foo, sizeof(foo)); warn_pass = atoi (foo); if (warn_pass == 0) @@ -361,7 +361,7 @@ main (void) printf ("Days after Password Expiry for Account Locking [%d]: ", DEFAULT_USER_DIE); fflush (stdout); - safeget (foo, sizeof (foo)); + safeget(foo, sizeof(foo)); user_die = atoi (foo); if (user_die == 0) user_die = DEFAULT_USER_DIE; @@ -385,7 +385,7 @@ main (void) min_pass, max_pass, warn_pass, user_die); printf ("\nIs this correct? [y/N]: "); fflush (stdout); - safeget (foo, sizeof (foo)); + safeget(foo, sizeof(foo)); done = bad = correct = (foo[0] == 'y' || foo[0] == 'Y'); @@ -398,7 +398,7 @@ main (void) *environ = NULL; - bzero (cmd, sizeof (cmd)); + bzero(cmd, sizeof(cmd)); sprintf (cmd, "%s -g %d -d %s -s %s -c \"%s\" -m -k /etc/skel %s", USERADD_PATH, group, dir, shell, person, usrname); printf ("Calling useradd to add new user:\n%s\n", cmd); @@ -416,7 +416,7 @@ main (void) */ setuid (0); - bzero (cmd, sizeof (cmd)); + bzero(cmd, sizeof(cmd)); /* Chage runs suid root. => we need ruid root to run it with * anything other than chage -l @@ -436,7 +436,7 @@ main (void) /* I want to add a user completely with one easy command --chris */ #ifdef HAVE_QUOTAS - bzero (cmd, sizeof (cmd)); + bzero(cmd, sizeof(cmd)); sprintf (cmd, "%s -p %s -u %s", EDQUOTA_PATH, QUOTA_DEFAULT, usrname); printf ("%s\n", cmd); if (system (cmd)) @@ -450,7 +450,7 @@ main (void) printf ("\nDefault quota set.\n"); #endif /* HAVE_QUOTAS */ - bzero (cmd, sizeof (cmd)); + bzero(cmd, sizeof(cmd)); sprintf (cmd, "%s %s", PASSWD_PATH, usrname); if (system (cmd)) { @@ -460,7 +460,7 @@ main (void) #endif } #ifdef IMMEDIATE_CHANGE - bzero (cmd, sizeof (cmd)); + bzero(cmd, sizeof(cmd)); sprintf (cmd, "%s -e %s", PASSWD_PATH, usrname); if (system (cmd)) { diff --git a/lib/addgrps.c b/lib/addgrps.c index 97c47e077f..cbddb043ea 100644 --- a/lib/addgrps.c +++ b/lib/addgrps.c @@ -42,7 +42,7 @@ add_groups(const char *list) int ret; FILE *shadow_logfd = log_get_logfd(); - if (strlen (list) >= sizeof (buf)) { + if (strlen(list) >= sizeof(buf)) { errno = EINVAL; return -1; } diff --git a/lib/commonio.c b/lib/commonio.c index f7bad1329b..64a0f30778 100644 --- a/lib/commonio.c +++ b/lib/commonio.c @@ -186,7 +186,7 @@ static int do_lock_file (const char *file, const char *lock, bool log) errno = EINVAL; return 0; } - len = read (fd, buf, sizeof (buf) - 1); + len = read(fd, buf, sizeof(buf) - 1); close (fd); if (len <= 0) { if (log) { @@ -774,7 +774,7 @@ commonio_sort (struct commonio_db *db, int (*cmp) (const void *, const void *)) entries[n] = ptr; n++; } - qsort (entries, n, sizeof (struct commonio_entry *), cmp); + qsort(entries, n, sizeof(struct commonio_entry *), cmp); /* Take care of the head and tail separately */ db->head = entries[0]; @@ -914,7 +914,7 @@ int commonio_close (struct commonio_db *db) goto fail; } - memzero (&sb, sizeof sb); + memzero(&sb, sizeof(sb)); if (NULL != db->fp) { if (fstat (fileno (db->fp), &sb) != 0) { (void) fclose (db->fp); diff --git a/lib/console.c b/lib/console.c index 642b3ba332..8078f72d21 100644 --- a/lib/console.c +++ b/lib/console.c @@ -74,7 +74,7 @@ is_listed(const char *cfgin, const char *tty, bool def) * See if this tty is listed in the console file. */ - while (fgets (buf, sizeof (buf), fp) != NULL) { + while (fgets(buf, sizeof(buf), fp) != NULL) { stpsep(buf, "\n"); if (strcmp (buf, tty) == 0) { (void) fclose (fp); diff --git a/lib/copydir.c b/lib/copydir.c index 0d855b7166..21a76d45c8 100644 --- a/lib/copydir.c +++ b/lib/copydir.c @@ -796,7 +796,7 @@ static int copy_file (const struct path_info *src, const struct path_info *dst, char buf[8192]; ssize_t cnt; - cnt = read (ifd, buf, sizeof buf); + cnt = read(ifd, buf, sizeof(buf)); if (cnt < 0) { if (errno == EINTR) { continue; diff --git a/lib/env.c b/lib/env.c index a49648d8b5..37eb24e06e 100644 --- a/lib/env.c +++ b/lib/env.c @@ -162,7 +162,7 @@ void set_env (int argc, char *const *argv) char *cp; for (; argc > 0; argc--, argv++) { - if (strlen (*argv) >= sizeof variable) { + if (strlen(*argv) >= sizeof(variable)) { continue; /* ignore long entries */ } diff --git a/lib/failure.c b/lib/failure.c index 298baf9d30..36a834ebd6 100644 --- a/lib/failure.c +++ b/lib/failure.c @@ -34,7 +34,7 @@ void failure (uid_t uid, const char *tty, struct faillog *fl) { int fd; - off_t offset_uid = (off_t) (sizeof *fl) * uid; + off_t offset_uid = (off_t) sizeof(*fl) * uid; /* * Don't do anything if failure logging isn't set up. @@ -59,7 +59,7 @@ void failure (uid_t uid, const char *tty, struct faillog *fl) */ if ( (lseek (fd, offset_uid, SEEK_SET) != offset_uid) - || (read (fd, fl, sizeof *fl) != (ssize_t) sizeof *fl)) { + || (read(fd, fl, sizeof(*fl)) != (ssize_t) sizeof(*fl))) { /* This is not necessarily a failure. The file is * initially zero length. * @@ -67,7 +67,7 @@ void failure (uid_t uid, const char *tty, struct faillog *fl) * might reset the counter. But the new failure will be * logged. */ - memzero (fl, sizeof *fl); + memzero(fl, sizeof(*fl)); } /* @@ -92,7 +92,7 @@ void failure (uid_t uid, const char *tty, struct faillog *fl) */ if ( (lseek (fd, offset_uid, SEEK_SET) != offset_uid) - || (write_full(fd, fl, sizeof *fl) == -1)) { + || (write_full(fd, fl, sizeof(*fl)) == -1)) { goto err_write; } @@ -150,7 +150,7 @@ int failcheck (uid_t uid, struct faillog *fl, bool failed) { int fd; struct faillog fail; - off_t offset_uid = (off_t) (sizeof *fl) * uid; + off_t offset_uid = (off_t) sizeof(*fl) * uid; /* * Suppress the check if the log file isn't there. @@ -182,7 +182,7 @@ int failcheck (uid_t uid, struct faillog *fl, bool failed) */ if ( (lseek (fd, offset_uid, SEEK_SET) != offset_uid) - || (read (fd, fl, sizeof *fl) != (ssize_t) sizeof *fl)) { + || (read(fd, fl, sizeof(*fl)) != (ssize_t) sizeof(*fl))) { (void) close (fd); return 1; } @@ -204,7 +204,7 @@ int failcheck (uid_t uid, struct faillog *fl, bool failed) fail.fail_cnt = 0; if ( (lseek (fd, offset_uid, SEEK_SET) != offset_uid) - || (write_full(fd, &fail, sizeof fail) == -1)) { + || (write_full(fd, &fail, sizeof(fail)) == -1)) { goto err_write; } diff --git a/lib/fields.c b/lib/fields.c index b4aa868c81..9c61b2209b 100644 --- a/lib/fields.c +++ b/lib/fields.c @@ -73,8 +73,8 @@ change_field(char *buf, size_t maxsize, const char *prompt) char newf[200]; char *cp; - if (maxsize > sizeof (newf)) { - maxsize = sizeof (newf); + if (maxsize > sizeof(newf)) { + maxsize = sizeof(newf); } printf ("\t%s [%s]: ", prompt, buf); diff --git a/lib/getdate.y b/lib/getdate.y index 385e55c692..e269bd85bf 100644 --- a/lib/getdate.y +++ b/lib/getdate.y @@ -770,7 +770,7 @@ yylex (void) if (isalpha (c)) { for (p = buff; (c = *yyInput++, isalpha (c)) || c == '.';) - if (p < &buff[sizeof buff - 1]) + if (p < &buff[sizeof(buff) - 1]) *p++ = c; stpcpy(p, ""); yyInput--; diff --git a/lib/getdef.c b/lib/getdef.c index 335c723e10..76ceb45ada 100644 --- a/lib/getdef.c +++ b/lib/getdef.c @@ -79,7 +79,7 @@ struct itemdef { {"MOTD_FIRSTONLY", NULL}, \ -#define NUMDEFS (sizeof(def_table)/sizeof(def_table[0])) +#define NUMDEFS (sizeof(def_table) / sizeof(def_table[0])) static struct itemdef def_table[] = { {"CHFN_RESTRICT", NULL}, {"CONSOLE_GROUPS", NULL}, @@ -157,7 +157,7 @@ static struct itemdef def_table[] = { {NULL, NULL} }; -#define NUMKNOWNDEFS (sizeof(knowndef_table)/sizeof(knowndef_table[0])) +#define NUMKNOWNDEFS (sizeof(knowndef_table) / sizeof(knowndef_table[0])) static struct itemdef knowndef_table[] = { #ifdef USE_PAM PAMDEFS @@ -556,7 +556,7 @@ static void def_load (void) /* * Go through all of the lines in the file. */ - while (fgets (buf, sizeof (buf), fp) != NULL) { + while (fgets(buf, sizeof(buf), fp) != NULL) { /* * Trim trailing whitespace. diff --git a/lib/hushed.c b/lib/hushed.c index caa687575a..817bd08453 100644 --- a/lib/hushed.c +++ b/lib/hushed.c @@ -72,7 +72,7 @@ bool hushed (const char *username) if (NULL == fp) { return false; } - for (found = false; !found && (fgets (buf, sizeof buf, fp) == buf);) { + for (found = false; !found && (fgets(buf, sizeof(buf), fp) == buf);) { stpsep(buf, "\n"); found = (strcmp (buf, pw->pw_shell) == 0) || (strcmp (buf, pw->pw_name) == 0); diff --git a/lib/log.c b/lib/log.c index e195a0f943..78ca4ba988 100644 --- a/lib/log.c +++ b/lib/log.c @@ -55,7 +55,7 @@ void dolastlog ( * for this UID. Negative UID's will create problems, but ... */ - offset = (off_t) pw->pw_uid * sizeof newlog; + offset = (off_t) pw->pw_uid * sizeof(newlog); if (lseek (fd, offset, SEEK_SET) != offset) { SYSLOG ((LOG_WARN, @@ -71,8 +71,8 @@ void dolastlog ( * the way we read the old one in. */ - if (read (fd, &newlog, sizeof newlog) != (ssize_t) sizeof newlog) { - memzero (&newlog, sizeof newlog); + if (read(fd, &newlog, sizeof(newlog)) != (ssize_t) sizeof(newlog)) { + memzero(&newlog, sizeof(newlog)); } if (NULL != ll) { *ll = newlog; @@ -86,7 +86,7 @@ void dolastlog ( STRNCPY(newlog.ll_host, host); #endif if ( (lseek (fd, offset, SEEK_SET) != offset) - || (write_full(fd, &newlog, sizeof newlog) == -1)) { + || (write_full(fd, &newlog, sizeof(newlog)) == -1)) { goto err_write; } diff --git a/lib/loginprompt.c b/lib/loginprompt.c index 7ab5e64d51..fb8b89ce92 100644 --- a/lib/loginprompt.c +++ b/lib/loginprompt.c @@ -73,7 +73,7 @@ login_prompt(char *name, int namesize) (void) fclose (fp); } } - (void) gethostname (buf, sizeof buf); + (void) gethostname(buf, sizeof(buf)); printf (_("\n%s login: "), buf); (void) fflush (stdout); @@ -83,7 +83,7 @@ login_prompt(char *name, int namesize) */ MEMZERO(buf); - if (fgets (buf, sizeof buf, stdin) != buf) { + if (fgets(buf, sizeof(buf), stdin) != buf) { exit (EXIT_FAILURE); } diff --git a/lib/setupenv.c b/lib/setupenv.c index 2e0b163628..ca9b15da39 100644 --- a/lib/setupenv.c +++ b/lib/setupenv.c @@ -54,7 +54,7 @@ static void read_env_file (const char *filename) if (NULL == fp) { return; } - while (fgets (buf, (int)(sizeof buf), fp) == buf) { + while (fgets(buf, (int) sizeof(buf), fp) == buf) { if (stpsep(buf, "\n") == NULL) break; diff --git a/lib/sgetpwent.c b/lib/sgetpwent.c index 2cf26d8217..c1f88fa720 100644 --- a/lib/sgetpwent.c +++ b/lib/sgetpwent.c @@ -50,7 +50,7 @@ sgetpwent(const char *buf) * the password structure remain valid. */ - if (strlen (buf) >= sizeof pwdbuf) { + if (strlen(buf) >= sizeof(pwdbuf)) { fprintf (shadow_logfd, "%s: Too long passwd entry encountered, file corruption?\n", shadow_progname); diff --git a/lib/sgetspent.c b/lib/sgetspent.c index 00d375d58d..b2cb77731d 100644 --- a/lib/sgetspent.c +++ b/lib/sgetspent.c @@ -48,7 +48,7 @@ sgetspent(const char *string) * have to do that to our private copy. */ - if (strlen (string) >= sizeof spwbuf) { + if (strlen(string) >= sizeof(spwbuf)) { fprintf (shadow_logfd, "%s: Too long passwd entry encountered, file corruption?\n", shadow_progname); diff --git a/lib/shadow.c b/lib/shadow.c index 44436836e8..4b2dd4a370 100644 --- a/lib/shadow.c +++ b/lib/shadow.c @@ -76,7 +76,7 @@ my_sgetspent(const char *string) * have to do that to our private copy. */ - if (strlen (string) >= sizeof spwbuf) + if (strlen(string) >= sizeof(spwbuf)) return 0; strcpy (spwbuf, string); stpsep(spwbuf, "\n"); @@ -202,7 +202,7 @@ struct spwd *fgetspent (FILE * fp) return (0); } - if (fgets (buf, sizeof buf, fp) != NULL) + if (fgets(buf, sizeof(buf), fp) != NULL) { stpsep(buf, "\n"); return my_sgetspent (buf); diff --git a/lib/subordinateio.c b/lib/subordinateio.c index 38a33d67bf..f19687ee9e 100644 --- a/lib/subordinateio.c +++ b/lib/subordinateio.c @@ -91,7 +91,7 @@ subordinate_parse(const char *line) * Copy the string to a temporary buffer so the substrings can * be modified to be NULL terminated. */ - if (strlen (line) >= sizeof rangebuf) + if (strlen(line) >= sizeof(rangebuf)) return NULL; /* fail if too long */ strcpy (rangebuf, line); diff --git a/lib/tcbfuncs.c b/lib/tcbfuncs.c index 34844b7b2d..14d5f81a34 100644 --- a/lib/tcbfuncs.c +++ b/lib/tcbfuncs.c @@ -125,7 +125,7 @@ static /*@null@*/ char *shadowtcb_path_rel_existing (const char *name) free (path); return NULL; } - ret = readlink (path, link, sizeof (link) - 1); + ret = readlink(path, link, sizeof(link) - 1); if (-1 == ret) { fprintf (shadow_logfd, _("%s: Cannot read symbolic link %s: %s\n"), diff --git a/lib/ttytype.c b/lib/ttytype.c index 850cb8d8ac..d10ae28fce 100644 --- a/lib/ttytype.c +++ b/lib/ttytype.c @@ -45,7 +45,7 @@ void ttytype (const char *line) perror (typefile); return; } - while (fgets (buf, sizeof buf, fp) == buf) { + while (fgets(buf, sizeof(buf), fp) == buf) { if (buf[0] == '#') { continue; } diff --git a/lib/tz.c b/lib/tz.c index 9506a8b16c..465abffd98 100644 --- a/lib/tz.c +++ b/lib/tz.c @@ -37,7 +37,7 @@ fp = fopen (fname, "r"); if ( (NULL == fp) - || (fgets (tzbuf, sizeof (tzbuf), fp) == NULL)) { + || (fgets(tzbuf, sizeof(tzbuf), fp) == NULL)) { def_tz = getdef_str ("ENV_TZ"); if ((NULL == def_tz) || ('/' == def_tz[0])) { def_tz = "TZ=CST6CDT"; diff --git a/lib/user_busy.c b/lib/user_busy.c index 495fa535a1..182e29c2fb 100644 --- a/lib/user_busy.c +++ b/lib/user_busy.c @@ -66,7 +66,7 @@ user_busy_utmp(const char *name) if (utent->ut_type != USER_PROCESS) { continue; } - if (strncmp (utent->ut_user, name, sizeof utent->ut_user) != 0) { + if (strncmp(utent->ut_user, name, sizeof(utent->ut_user)) != 0) { continue; } if (kill (utent->ut_pid, 0) != 0) { @@ -96,10 +96,10 @@ static int different_namespace (const char *sname) SNPRINTF(path, "/proc/%s/ns/user", sname); - if ((llen1 = readlink (path, buf, sizeof(buf))) == -1) + if ((llen1 = readlink(path, buf, sizeof(buf))) == -1) return 0; - if ((llen2 = readlink ("/proc/self/ns/user", buf2, sizeof(buf2))) == -1) + if ((llen2 = readlink("/proc/self/ns/user", buf2, sizeof(buf2))) == -1) return 0; if (llen1 == llen2 && memcmp (buf, buf2, llen1) == 0) @@ -123,7 +123,7 @@ static int check_status (const char *name, const char *sname, uid_t uid) if (NULL == sfile) { return 0; } - while (fgets (line, sizeof (line), sfile) == line) { + while (fgets(line, sizeof(line), sfile) == line) { if (strncmp (line, "Uid:\t", 5) == 0) { unsigned long ruid, euid, suid; diff --git a/lib/utmp.c b/lib/utmp.c index de1e2006f6..f324a00d3f 100644 --- a/lib/utmp.c +++ b/lib/utmp.c @@ -108,7 +108,7 @@ failtmp(const char *username, const struct utmpx *failent) * Append the new failure record and close the log file. */ - if (write_full(fd, failent, sizeof *failent) == -1) { + if (write_full(fd, failent, sizeof(*failent)) == -1) { goto err_write; } @@ -169,7 +169,7 @@ get_current_utmp(void) if (NULL != ut) { ret = XMALLOC(1, struct utmpx); - memcpy (ret, ut, sizeof (*ret)); + memcpy(ret, ut, sizeof(*ret)); } endutxent(); @@ -287,8 +287,8 @@ prepare_utmp(const char *name, const char *line, const char *host, STRNCPY(utent->ut_host, hostname); #endif #if defined(HAVE_STRUCT_UTMPX_UT_SYSLEN) - utent->ut_syslen = MIN (strlen (hostname), - sizeof (utent->ut_host)); + utent->ut_syslen = MIN(strlen(hostname), + sizeof(utent->ut_host)); #endif #if defined(HAVE_STRUCT_UTMPX_UT_ADDR) || defined(HAVE_STRUCT_UTMPX_UT_ADDR_V6) if (getaddrinfo (hostname, NULL, NULL, &info) == 0) { @@ -301,21 +301,21 @@ prepare_utmp(const char *name, const char *line, const char *host, # if defined(HAVE_STRUCT_UTMPX_UT_ADDR) memcpy (&(utent->ut_addr), &(sa->sin_addr), - MIN (sizeof (utent->ut_addr), - sizeof (sa->sin_addr))); + MIN(sizeof(utent->ut_addr), + sizeof(sa->sin_addr))); # endif # if defined(HAVE_STRUCT_UTMPX_UT_ADDR_V6) memcpy (utent->ut_addr_v6, &(sa->sin_addr), - MIN (sizeof (utent->ut_addr_v6), - sizeof (sa->sin_addr))); + MIN(sizeof(utent->ut_addr_v6), + sizeof(sa->sin_addr))); } else if (info->ai_family == AF_INET6) { struct sockaddr_in6 *sa = (struct sockaddr_in6 *) info->ai_addr; memcpy (utent->ut_addr_v6, &(sa->sin6_addr), - MIN (sizeof (utent->ut_addr_v6), - sizeof (sa->sin6_addr))); + MIN(sizeof(utent->ut_addr_v6), + sizeof(sa->sin6_addr))); # endif } freeaddrinfo (info); diff --git a/src/chage.c b/src/chage.c index 5146fde0ab..d5af6e8da4 100644 --- a/src/chage.c +++ b/src/chage.c @@ -170,12 +170,12 @@ static int new_fields (void) (void) puts (""); SNPRINTF(buf, "%ld", mindays); - change_field (buf, sizeof buf, _("Minimum Password Age")); + change_field(buf, sizeof(buf), _("Minimum Password Age")); if (a2sl(&mindays, buf, NULL, 0, -1, LONG_MAX) == -1) return 0; SNPRINTF(buf, "%ld", maxdays); - change_field (buf, sizeof buf, _("Maximum Password Age")); + change_field(buf, sizeof(buf), _("Maximum Password Age")); if (a2sl(&maxdays, buf, NULL, 0, -1, LONG_MAX) == -1) return 0; @@ -184,7 +184,7 @@ static int new_fields (void) else DAY_TO_STR(buf, lstchgdate); - change_field (buf, sizeof buf, _("Last Password Change (YYYY-MM-DD)")); + change_field(buf, sizeof(buf), _("Last Password Change (YYYY-MM-DD)")); if (strcmp (buf, "-1") == 0) { lstchgdate = -1; @@ -196,12 +196,12 @@ static int new_fields (void) } SNPRINTF(buf, "%ld", warndays); - change_field (buf, sizeof buf, _("Password Expiration Warning")); + change_field(buf, sizeof(buf), _("Password Expiration Warning")); if (a2sl(&warndays, buf, NULL, 0, -1, LONG_MAX) == -1) return 0; SNPRINTF(buf, "%ld", inactdays); - change_field (buf, sizeof buf, _("Password Inactive")); + change_field(buf, sizeof(buf), _("Password Inactive")); if (a2sl(&inactdays, buf, NULL, 0, -1, LONG_MAX) == -1) return 0; @@ -210,7 +210,7 @@ static int new_fields (void) else DAY_TO_STR(buf, expdate); - change_field (buf, sizeof buf, + change_field(buf, sizeof(buf), _("Account Expiration Date (YYYY-MM-DD)")); if (strcmp (buf, "-1") == 0) { @@ -639,7 +639,7 @@ static void update_age (/*@null@*/const struct spwd *sp, if (NULL == sp) { struct passwd pwent = *pw; - memzero (&spwent, sizeof spwent); + memzero(&spwent, sizeof(spwent)); spwent.sp_namp = xstrdup (pwent.pw_name); spwent.sp_pwdp = xstrdup (pwent.pw_passwd); spwent.sp_flag = SHADOW_SP_FLAG_UNSET; diff --git a/src/chfn.c b/src/chfn.c index 0a837fbe35..382c7e3ff2 100644 --- a/src/chfn.c +++ b/src/chfn.c @@ -175,31 +175,31 @@ static void new_fields (void) puts (_("Enter the new value, or press ENTER for the default")); if (may_change_field ('f')) { - change_field (fullnm, sizeof fullnm, _("Full Name")); + change_field(fullnm, sizeof(fullnm), _("Full Name")); } else { printf (_("\t%s: %s\n"), _("Full Name"), fullnm); } if (may_change_field ('r')) { - change_field (roomno, sizeof roomno, _("Room Number")); + change_field(roomno, sizeof(roomno), _("Room Number")); } else { printf (_("\t%s: %s\n"), _("Room Number"), roomno); } if (may_change_field ('w')) { - change_field (workph, sizeof workph, _("Work Phone")); + change_field(workph, sizeof(workph), _("Work Phone")); } else { printf (_("\t%s: %s\n"), _("Work Phone"), workph); } if (may_change_field ('h')) { - change_field (homeph, sizeof homeph, _("Home Phone")); + change_field(homeph, sizeof(homeph), _("Home Phone")); } else { printf (_("\t%s: %s\n"), _("Home Phone"), homeph); } if (amroot) { - change_field (slop, sizeof slop, _("Other")); + change_field(slop, sizeof(slop), _("Other")); } } diff --git a/src/chgpasswd.c b/src/chgpasswd.c index 50a299aed8..4035f2d96c 100644 --- a/src/chgpasswd.c +++ b/src/chgpasswd.c @@ -459,7 +459,7 @@ int main (int argc, char **argv) * group entry for each group will be looked up in the appropriate * file (gshadow or group) and the password changed. */ - while (fgets (buf, (int) sizeof buf, stdin) != NULL) { + while (fgets(buf, (int) sizeof(buf), stdin) != NULL) { line++; if (stpsep(buf, "\n") == NULL) { fprintf (stderr, _("%s: line %d: line too long\n"), diff --git a/src/chpasswd.c b/src/chpasswd.c index 6bbcbac9eb..87b369e41d 100644 --- a/src/chpasswd.c +++ b/src/chpasswd.c @@ -501,14 +501,14 @@ main(int argc, char **argv) * last change date is set in the age only if aging information is * present. */ - while (fgets (buf, sizeof buf, stdin) != NULL) { + while (fgets(buf, sizeof(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, sizeof(buf), stdin) != NULL) { if (!!strchr(buf, '\n')) break; } diff --git a/src/chsh.c b/src/chsh.c index 4e85678da1..400b3520ea 100644 --- a/src/chsh.c +++ b/src/chsh.c @@ -115,7 +115,7 @@ usage (int status) static void new_fields (void) { puts (_("Enter the new value, or press ENTER for the default")); - change_field (loginsh, sizeof loginsh, _("Login Shell")); + change_field(loginsh, sizeof(loginsh), _("Login Shell")); } /* diff --git a/src/faillog.c b/src/faillog.c index cf02924998..fa1f62cc17 100644 --- a/src/faillog.c +++ b/src/faillog.c @@ -244,7 +244,7 @@ static bool reset_one (uid_t uid) fl.fail_cnt = 0; if ( (fseeko (fail, offset, SEEK_SET) == 0) - && (fwrite (&fl, sizeof (fl), 1, fail) == 1)) { + && (fwrite(&fl, sizeof(fl), 1, fail) == 1)) { (void) fflush (fail); return false; } @@ -265,7 +265,7 @@ static void reset (void) /* There is no need to reset outside of the faillog * database. */ - uid_t uidmax = statbuf.st_size / sizeof (struct faillog); + uid_t uidmax = statbuf.st_size / sizeof(struct faillog); if (uidmax > 1) { uidmax--; } @@ -340,7 +340,7 @@ static bool setmax_one (uid_t uid, short max) fl.fail_max = max; if ( (fseeko (fail, offset, SEEK_SET) == 0) - && (fwrite (&fl, sizeof (fl), 1, fail) == 1)) { + && (fwrite(&fl, sizeof(fl), 1, fail) == 1)) { (void) fflush (fail); return false; } @@ -371,7 +371,7 @@ static void setmax (short max) /* The default umax value is based on the size of the * faillog database. */ - uid_t uidmax = statbuf.st_size / sizeof (struct faillog); + uid_t uidmax = statbuf.st_size / sizeof(struct faillog); if (uidmax > 1) { uidmax--; } @@ -438,7 +438,7 @@ static bool set_locktime_one (uid_t uid, long locktime) fl.fail_locktime = locktime; if ( (fseeko (fail, offset, SEEK_SET) == 0) - && (fwrite (&fl, sizeof (fl), 1, fail) == 1)) { + && (fwrite(&fl, sizeof(fl), 1, fail) == 1)) { (void) fflush (fail); return false; } @@ -469,7 +469,7 @@ static void set_locktime (long locktime) /* The default umax value is based on the size of the * faillog database. */ - uid_t uidmax = statbuf.st_size / sizeof (struct faillog); + uid_t uidmax = statbuf.st_size / sizeof(struct faillog); if (uidmax > 1) { uidmax--; } diff --git a/src/groupadd.c b/src/groupadd.c index 5a674805ff..ea72fb8e9b 100644 --- a/src/groupadd.c +++ b/src/groupadd.c @@ -128,7 +128,7 @@ usage (int status) */ static void new_grent (struct group *grent) { - memzero (grent, sizeof *grent); + memzero(grent, sizeof(*grent)); grent->gr_name = group_name; if (pflg) { grent->gr_passwd = group_passwd; @@ -148,7 +148,7 @@ static void new_grent (struct group *grent) */ static void new_sgent (struct sgrp *sgent) { - memzero (sgent, sizeof *sgent); + memzero(sgent, sizeof(*sgent)); sgent->sg_name = group_name; if (pflg) { sgent->sg_passwd = group_passwd; diff --git a/src/groupmod.c b/src/groupmod.c index 5f22ba9ef2..6555c0a753 100644 --- a/src/groupmod.c +++ b/src/groupmod.c @@ -236,7 +236,7 @@ grp_update(void) * shadowed password, we force the creation of a * gshadow entry when a new password is requested. */ - bzero(&sgrp, sizeof sgrp); + bzero(&sgrp, sizeof(sgrp)); sgrp.sg_name = xstrdup (grp.gr_name); sgrp.sg_passwd = xstrdup (grp.gr_passwd); sgrp.sg_adm = ∅ diff --git a/src/grpconv.c b/src/grpconv.c index 4d941cdce1..078b793575 100644 --- a/src/grpconv.c +++ b/src/grpconv.c @@ -200,7 +200,7 @@ int main (int argc, char **argv) static char *empty = 0; /* add new shadow group entry */ - bzero(&sgent, sizeof sgent); + bzero(&sgent, sizeof(sgent)); sgent.sg_name = gr->gr_name; sgent.sg_passwd = gr->gr_passwd; sgent.sg_adm = ∅ diff --git a/src/lastlog.c b/src/lastlog.c index 085e70cd03..0bb33dd016 100644 --- a/src/lastlog.c +++ b/src/lastlog.c @@ -113,8 +113,8 @@ static void print_one (/*@null@*/const struct passwd *pw) } - offset = (off_t) pw->pw_uid * sizeof (ll); - if (offset + sizeof (ll) <= statbuf.st_size) { + offset = (off_t) pw->pw_uid * sizeof(ll); + if (offset + sizeof(ll) <= statbuf.st_size) { /* fseeko errors are not really relevant for us. */ int err = fseeko (lastlogfile, offset, SEEK_SET); assert (0 == err); @@ -122,7 +122,7 @@ static void print_one (/*@null@*/const struct passwd *pw) * entered for this user, which should be able to get the * empty entry in this case. */ - if (fread (&ll, sizeof (ll), 1, lastlogfile) != 1) { + if (fread(&ll, sizeof(ll), 1, lastlogfile) != 1) { fprintf (stderr, _("%s: Failed to get the entry for UID %lu\n"), Prog, (unsigned long)pw->pw_uid); @@ -134,7 +134,7 @@ static void print_one (/*@null@*/const struct passwd *pw) * as if we were reading an non existing entry in the * sparse lastlog file). */ - memzero (&ll, sizeof (ll)); + memzero(&ll, sizeof(ll)); } /* Filter out entries that do not match with the -t or -b options */ @@ -217,12 +217,12 @@ static void update_one (/*@null@*/const struct passwd *pw) return; } - offset = (off_t) pw->pw_uid * sizeof (ll); + offset = (off_t) pw->pw_uid * sizeof(ll); /* fseeko errors are not really relevant for us. */ err = fseeko (lastlogfile, offset, SEEK_SET); assert (0 == err); - memzero (&ll, sizeof (ll)); + memzero(&ll, sizeof(ll)); if (Sflg) { ll.ll_time = NOW; @@ -244,7 +244,7 @@ static void update_one (/*@null@*/const struct passwd *pw) } #endif - if (fwrite (&ll, sizeof(ll), 1, lastlogfile) != 1) { + if (fwrite(&ll, sizeof(ll), 1, lastlogfile) != 1) { fprintf (stderr, _("%s: Failed to update the entry for UID %lu\n"), Prog, (unsigned long)pw->pw_uid); diff --git a/src/login.c b/src/login.c index 9d7c8bfd5f..794cc160ec 100644 --- a/src/login.c +++ b/src/login.c @@ -648,7 +648,7 @@ int main (int argc, char **argv) unsigned int failcount = 0; /* Make the login prompt look like we want it */ - if (gethostname (hostn, sizeof (hostn)) == 0) { + if (gethostname(hostn, sizeof(hostn)) == 0) { SNPRINTF(loginprompt, _("%s login: "), hostn); } else { STRTCPY(loginprompt, _("login: ")); @@ -1206,7 +1206,7 @@ int main (int argc, char **argv) #ifdef HAVE_LL_HOST /* __linux__ || SUN4 */ if ('\0' != ll.ll_host[0]) { printf (_(" from %.*s"), - (int) sizeof ll.ll_host, ll.ll_host); + (int) sizeof(ll.ll_host), ll.ll_host); } #endif printf (".\n"); diff --git a/src/login_nopam.c b/src/login_nopam.c index f5a7f96543..0f3b235ae6 100644 --- a/src/login_nopam.c +++ b/src/login_nopam.c @@ -99,7 +99,7 @@ login_access(const char *user, const char *from) if (NULL != fp) { int lineno = 0; /* for diagnostics */ while ( !match - && (fgets (line, sizeof (line), fp) == line)) + && (fgets(line, sizeof(line), fp) == line)) { char *p; @@ -186,7 +186,7 @@ myhostname(void) static char name[MAXHOSTNAMELEN + 1] = ""; if (strcmp(name, "") == 0) { - gethostname (name, sizeof (name)); + gethostname(name, sizeof(name)); stpcpy(&name[MAXHOSTNAMELEN], ""); } return (name); diff --git a/src/newusers.c b/src/newusers.c index bd24f7c720..6dde9515e7 100644 --- a/src/newusers.c +++ b/src/newusers.c @@ -1100,7 +1100,7 @@ int main (int argc, char **argv) * over 100 is allocated. The pw_gid field will be updated with that * value. */ - while (fgets (buf, sizeof buf, stdin) != NULL) { + while (fgets(buf, sizeof(buf), stdin) != NULL) { line++; if (stpsep(buf, "\n") == NULL && feof(stdin) == 0) { fprintf (stderr, _("%s: line %d: line too long\n"), diff --git a/src/pwconv.c b/src/pwconv.c index 7dd327ae00..1a164951a0 100644 --- a/src/pwconv.c +++ b/src/pwconv.c @@ -238,7 +238,7 @@ int main (int argc, char **argv) spent = *sp; } else { /* add new shadow entry */ - bzero(&spent, sizeof spent); + bzero(&spent, sizeof(spent)); spent.sp_namp = pw->pw_name; spent.sp_min = getdef_num ("PASS_MIN_DAYS", -1); spent.sp_max = getdef_num ("PASS_MAX_DAYS", -1); diff --git a/src/suauth.c b/src/suauth.c index 4d9df2004d..f6d6979217 100644 --- a/src/suauth.c +++ b/src/suauth.c @@ -70,7 +70,7 @@ check_su_auth(const char *actual_id, const char *wanted_id, bool su_to_root) return DENY; } - while (fgets (temp, sizeof (temp), authfile_fd) != NULL) { + while (fgets(temp, sizeof(temp), authfile_fd) != NULL) { char *p; lines++; diff --git a/src/useradd.c b/src/useradd.c index d5f68dc7d5..9f806eeaf1 100644 --- a/src/useradd.c +++ b/src/useradd.c @@ -360,7 +360,7 @@ get_defaults(void) * 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) == buf) { stpsep(buf, "\n"); cp = stpsep(buf, "="); @@ -600,7 +600,7 @@ set_defaults(void) goto skip; } - while (fgets (buf, sizeof buf, ifp) == buf) { + while (fgets(buf, sizeof(buf), ifp) == buf) { char *val; if (stpsep(buf, "\n") == NULL) { @@ -937,7 +937,7 @@ static void usage (int status) */ static void new_pwent (struct passwd *pwent) { - memzero (pwent, sizeof *pwent); + memzero(pwent, sizeof(*pwent)); pwent->pw_name = (char *) user_name; if (is_shadow_pwd) { pwent->pw_passwd = (char *) SHADOW_PASSWD_STRING; @@ -960,7 +960,7 @@ static void new_pwent (struct passwd *pwent) */ static void new_spent (struct spwd *spent) { - memzero (spent, sizeof *spent); + memzero(spent, sizeof(*spent)); spent->sp_namp = (char *) user_name; spent->sp_pwdp = (char *) user_pass; spent->sp_lstchg = gettime () / DAY; @@ -1872,7 +1872,7 @@ static char *empty_list = NULL; static void new_grent (struct group *grent) { - memzero (grent, sizeof *grent); + memzero(grent, sizeof(*grent)); grent->gr_name = (char *) user_name; #ifdef SHADOWGRP if (is_shadow_grp) { @@ -1896,7 +1896,7 @@ static void new_grent (struct group *grent) static void new_sgent (struct sgrp *sgent) { - memzero (sgent, sizeof *sgent); + memzero(sgent, sizeof(*sgent)); sgent->sg_name = (char *) user_name; sgent->sg_passwd = "!"; /* XXX warning: const */ sgent->sg_adm = &empty_list; @@ -1973,14 +1973,14 @@ static void faillog_reset (uid_t uid) { struct faillog fl; int fd; - off_t offset_uid = (off_t) (sizeof fl) * uid; + off_t offset_uid = (off_t) sizeof(fl) * uid; struct stat st; if (stat (FAILLOG_FILE, &st) != 0 || st.st_size <= offset_uid) { return; } - memzero (&fl, sizeof (fl)); + memzero(&fl, sizeof(fl)); fd = open (FAILLOG_FILE, O_RDWR); if (-1 == fd) { @@ -1991,7 +1991,7 @@ static void faillog_reset (uid_t uid) return; } if ( (lseek (fd, offset_uid, SEEK_SET) != offset_uid) - || (write_full(fd, &fl, sizeof (fl)) == -1) + || (write_full(fd, &fl, sizeof(fl)) == -1) || (fsync (fd) != 0)) { fprintf (stderr, _("%s: failed to reset the faillog entry of UID %lu: %s\n"), @@ -2011,7 +2011,7 @@ static void lastlog_reset (uid_t uid) { struct lastlog ll; int fd; - off_t offset_uid = (off_t) (sizeof ll) * uid; + off_t offset_uid = (off_t) sizeof(ll) * uid; uid_t max_uid; struct stat st; @@ -2025,7 +2025,7 @@ static void lastlog_reset (uid_t uid) return; } - memzero (&ll, sizeof (ll)); + memzero(&ll, sizeof(ll)); fd = open (LASTLOG_FILE, O_RDWR); if (-1 == fd) { @@ -2036,7 +2036,7 @@ static void lastlog_reset (uid_t uid) return; } if ( (lseek (fd, offset_uid, SEEK_SET) != offset_uid) - || (write_full (fd, &ll, sizeof (ll)) != (ssize_t) sizeof (ll)) + || (write_full(fd, &ll, sizeof(ll)) != (ssize_t) sizeof(ll)) || (fsync (fd) != 0)) { fprintf (stderr, _("%s: failed to reset the lastlog entry of UID %lu: %s\n"), diff --git a/src/usermod.c b/src/usermod.c index 6bedc61dd7..90f23d6f81 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -1729,7 +1729,7 @@ static void usr_update (void) * a shadowed password * + aging information is requested */ - bzero(&spent, sizeof spent); + bzero(&spent, sizeof(spent)); spent.sp_namp = user_name; /* The user explicitly asked for a shadow feature. @@ -1907,8 +1907,8 @@ static void update_lastlog (void) { struct lastlog ll; int fd; - off_t off_uid = (off_t) user_id * sizeof ll; - off_t off_newuid = (off_t) user_newid * sizeof ll; + off_t off_uid = (off_t) user_id * sizeof(ll); + off_t off_newuid = (off_t) user_newid * sizeof(ll); uid_t max_uid; if (access (LASTLOG_FILE, F_OK) != 0) { @@ -1931,10 +1931,10 @@ static void update_lastlog (void) } if ( (lseek (fd, off_uid, SEEK_SET) == off_uid) - && (read (fd, &ll, sizeof ll) == (ssize_t) sizeof ll)) { + && (read(fd, &ll, sizeof(ll)) == (ssize_t) sizeof(ll))) { /* Copy the old entry to its new location */ if ( (lseek (fd, off_newuid, SEEK_SET) != off_newuid) - || (write_full(fd, &ll, sizeof ll) == -1) + || (write_full(fd, &ll, sizeof(ll)) == -1) || (fsync (fd) != 0)) { fprintf (stderr, _("%s: failed to copy the lastlog entry of user %lu to user %lu: %s\n"), @@ -1946,11 +1946,11 @@ static void update_lastlog (void) /* Check if the new UID already has an entry */ if ( (lseek (fd, off_newuid, SEEK_SET) == off_newuid) - && (read (fd, &ll, sizeof ll) == (ssize_t) sizeof ll)) { + && (read(fd, &ll, sizeof(ll)) == (ssize_t) sizeof(ll))) { /* Reset the new uid's lastlog entry */ - memzero (&ll, sizeof (ll)); + memzero(&ll, sizeof(ll)); if ( (lseek (fd, off_newuid, SEEK_SET) != off_newuid) - || (write_full(fd, &ll, sizeof ll) == -1) + || (write_full(fd, &ll, sizeof(ll)) == -1) || (fsync (fd) != 0)) { fprintf (stderr, _("%s: failed to copy the lastlog entry of user %lu to user %lu: %s\n"), @@ -1978,8 +1978,8 @@ static void update_faillog (void) { struct faillog fl; int fd; - off_t off_uid = (off_t) user_id * sizeof fl; - off_t off_newuid = (off_t) user_newid * sizeof fl; + off_t off_uid = (off_t) user_id * sizeof(fl); + off_t off_newuid = (off_t) user_newid * sizeof(fl); if (access (FAILLOG_FILE, F_OK) != 0) { return; @@ -1995,10 +1995,10 @@ static void update_faillog (void) } if ( (lseek (fd, off_uid, SEEK_SET) == off_uid) - && (read (fd, &fl, sizeof fl) == (ssize_t) sizeof fl)) { + && (read(fd, &fl, sizeof(fl)) == (ssize_t) sizeof(fl))) { /* Copy the old entry to its new location */ if ( (lseek (fd, off_newuid, SEEK_SET) != off_newuid) - || (write_full(fd, &fl, sizeof fl) == -1) + || (write_full(fd, &fl, sizeof(fl)) == -1) || (fsync (fd) != 0)) { fprintf (stderr, _("%s: failed to copy the faillog entry of user %lu to user %lu: %s\n"), @@ -2010,11 +2010,11 @@ static void update_faillog (void) /* Check if the new UID already has an entry */ if ( (lseek (fd, off_newuid, SEEK_SET) == off_newuid) - && (read (fd, &fl, sizeof fl) == (ssize_t) sizeof fl)) { + && (read(fd, &fl, sizeof(fl)) == (ssize_t) sizeof(fl))) { /* Reset the new uid's faillog entry */ - memzero (&fl, sizeof (fl)); + memzero(&fl, sizeof(fl)); if ( (lseek (fd, off_newuid, SEEK_SET) != off_newuid) - || (write_full(fd, &fl, sizeof fl) == -1)) + || (write_full(fd, &fl, sizeof(fl)) == -1)) { fprintf (stderr, _("%s: failed to copy the faillog entry of user %lu to user %lu: %s\n"),