summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Schouten <ed@80386.nl>2011-06-24 15:52:18 +0200
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-06-24 20:56:32 -0700
commitdd5d4c9721417a21133bb44a0567a041a166bd5e (patch)
treed40ffa0771e9c9761dd9e317b195632eee79c881
parent301cbd433bb698147e05e7dbfb4de2ce2e0e9cbb (diff)
Get rid of bzero() calls. Replace them by memset().
bzero() is not part of POSIX; memset() is. Signed-off-by: Ed Schouten <ed@80386.nl> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--sessreg.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sessreg.c b/sessreg.c
index 9ce4653..7bce6ef 100644
--- a/sessreg.c
+++ b/sessreg.c
@@ -366,7 +366,7 @@ main (int argc, char **argv)
sysnerr (lseek(llog, (long) pwd->pw_uid*sizeof(ll), 0)
!= -1, "seeking lastlog entry");
- bzero((char *)&ll, sizeof(ll));
+ memset(&ll, 0, sizeof(ll));
ll.ll_time = current_time;
if (line)
(void) strncpy (ll.ll_line, line, sizeof (ll.ll_line));
@@ -390,15 +390,15 @@ main (int argc, char **argv)
static void
set_utmp (struct utmp *u, char *line, char *user, char *host, Time_t date, int addp)
{
- bzero (u, sizeof (*u));
+ memset (u, 0, sizeof (*u));
if (line)
(void) strncpy (u->ut_line, line, sizeof (u->ut_line));
else
- bzero (u->ut_line, sizeof (u->ut_line));
+ memset (u->ut_line, 0, sizeof (u->ut_line));
if (addp && user)
(void) strncpy (u->ut_name, user, sizeof (u->ut_name));
else
- bzero (u->ut_name, sizeof (u->ut_name));
+ memset (u->ut_name, 0, sizeof (u->ut_name));
#ifdef HAVE_STRUCT_UTMP_UT_ID
if (line) {
int i;
@@ -416,7 +416,7 @@ set_utmp (struct utmp *u, char *line, char *user, char *host, Time_t date, int a
i = 0;
(void) strncpy (u->ut_id, line + i, sizeof (u->ut_id));
} else
- bzero (u->ut_id, sizeof (u->ut_id));
+ memset (u->ut_id, 0, sizeof (u->ut_id));
#endif
#ifdef HAVE_STRUCT_UTMP_UT_PID
if (addp)
@@ -434,7 +434,7 @@ set_utmp (struct utmp *u, char *line, char *user, char *host, Time_t date, int a
if (addp && host)
(void) strncpy (u->ut_host, host, sizeof (u->ut_host));
else
- bzero (u->ut_host, sizeof (u->ut_host));
+ memset (u->ut_host, 0, sizeof (u->ut_host));
#endif
u->ut_time = date;
}
@@ -483,11 +483,11 @@ set_utmpx (struct utmpx *u, const char *line, const char *user,
#endif
}
else
- bzero (u->ut_line, sizeof (u->ut_line));
+ memset (u->ut_line, 0, sizeof (u->ut_line));
if (addp && user)
(void) strncpy (u->ut_user, user, sizeof (u->ut_user));
else
- bzero (u->ut_user, sizeof (u->ut_user));
+ memset (u->ut_user, 0, sizeof (u->ut_user));
if (line) {
int i;
@@ -532,7 +532,7 @@ set_utmpx (struct utmpx *u, const char *line, const char *user,
endutxent();
}
} else
- bzero (u->ut_id, sizeof (u->ut_id));
+ memset (u->ut_id, 0, sizeof (u->ut_id));
if (addp) {
u->ut_pid = getppid ();