diff options
-rw-r--r-- | sysdeps/osf1/ChangeLog | 5 | ||||
-rw-r--r-- | sysdeps/osf1/procdata.c | 2 | ||||
-rw-r--r-- | sysdeps/osf1/procstate.c | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/sysdeps/osf1/ChangeLog b/sysdeps/osf1/ChangeLog index bc503fa5..b9714f3b 100644 --- a/sysdeps/osf1/ChangeLog +++ b/sysdeps/osf1/ChangeLog @@ -1,3 +1,8 @@ +2004-06-06 Benoît Dejean <tazforever@dlfp.org> + + * procdata.c: (glibtop_get_procdata_r): Removed duplicated memset. + * procstate.c: (glibtop_get_proc_state_p): Replaced strncpy by g_strlcpy. + 2004-05-25 Benoît Dejean <tazforever@dlfp.org> * sem_limits.c: diff --git a/sysdeps/osf1/procdata.c b/sysdeps/osf1/procdata.c index 96bb1430..e82e64fa 100644 --- a/sysdeps/osf1/procdata.c +++ b/sysdeps/osf1/procdata.c @@ -63,8 +63,6 @@ glibtop_get_procdata_r (glibtop *server, glibtop_procdata *buf, pid_t pid) task_t thistask; int ret, info_count; - memset (buf, 0, sizeof (glibtop_procdata)); - glibtop_init (); memset (buf, 0, sizeof (glibtop_procdata)); diff --git a/sysdeps/osf1/procstate.c b/sysdeps/osf1/procstate.c index 108291c7..71447877 100644 --- a/sysdeps/osf1/procstate.c +++ b/sysdeps/osf1/procstate.c @@ -81,9 +81,7 @@ glibtop_get_proc_state_p (glibtop *server, glibtop_proc_state *buf, return; } - strncpy (buf->cmd, procinfo.pi_comm, sizeof (buf->cmd)-1); - - buf->cmd [sizeof (buf->cmd)-1] = 0; + g_strlcpy (buf->cmd, procinfo.pi_comm, sizeof buf->cmd); buf->uid = procinfo.pi_svuid; buf->gid = procinfo.pi_svgid; |