From: Sami Kerola Date: Sat, 24 Nov 2012 10:35:08 +0000 (+0000) Subject: compliancy: use memset() rather than bzero() X-Git-Tag: cronie1.4.10~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39ff62128d1b3fd5685507cd0dc76f436df3950d;p=cronie compliancy: use memset() rather than bzero() Reference: http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xsh_chap03.html Signed-off-by: Sami Kerola --- diff --git a/src/cron.c b/src/cron.c index 49052b6..cd36a90 100644 --- a/src/cron.c +++ b/src/cron.c @@ -196,7 +196,7 @@ int main(int argc, char *argv[]) { ChangePath = 1; parse_args(argc, argv); - bzero((char *) &sact, sizeof sact); + memset((char *) &sact, 0, sizeof sact); sigemptyset(&sact.sa_mask); sact.sa_flags = 0; #ifdef SA_RESTART diff --git a/src/entry.c b/src/entry.c index f09427c..f6a45bb 100644 --- a/src/entry.c +++ b/src/entry.c @@ -281,7 +281,7 @@ entry *load_entry(FILE * file, void (*error_func) (), struct passwd *pw, ecode = e_memory; goto eof; } - bzero(e->pwd->pw_passwd, strlen(e->pwd->pw_passwd)); + memset(e->pwd->pw_passwd, 0, strlen(e->pwd->pw_passwd)); /* copy and fix up environment. some variables are just defaults and * others are overrides. diff --git a/src/env.c b/src/env.c index d187ed9..2b300fb 100644 --- a/src/env.c +++ b/src/env.c @@ -135,8 +135,8 @@ int load_env(char *envstr, FILE * f) { Debug(DPARS, ("load_env, read <%s>\n", envstr)) - bzero(name, sizeof name); - bzero(val, sizeof val); + memset(name, 0, sizeof name); + memset(val, 0, sizeof val); str = name; state = NAMEI; quotechar = '\0'; diff --git a/src/misc.c b/src/misc.c index a617709..b43cf28 100644 --- a/src/misc.c +++ b/src/misc.c @@ -308,7 +308,7 @@ void acquire_daemonlock(int closeflag) { if (trylock_file(fd) < OK) { int save_errno = errno; - bzero(buf, sizeof (buf)); + memset(buf, 0, sizeof (buf)); if ((num = read(fd, buf, sizeof (buf) - 1)) > 0 && (otherpid = strtol(buf, &ep, 10)) > 0 && ep != buf && *ep == '\n' && otherpid != LONG_MAX) { diff --git a/src/popen.c b/src/popen.c index baf0724..caa7e8a 100644 --- a/src/popen.c +++ b/src/popen.c @@ -69,7 +69,7 @@ FILE *cron_popen(char *program, const char *type, struct passwd *pw) { return (NULL); if (!(pids = (PID_T *) malloc((u_int) (fds * sizeof (PID_T))))) return (NULL); - bzero((char *) pids, fds * sizeof (PID_T)); + memset((char *) pids, 0, fds * sizeof (PID_T)); } if (pipe(pdes) < 0) return (NULL);