summaryrefslogtreecommitdiff
path: root/sysdeps/osf1/procstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/osf1/procstate.c')
-rw-r--r--sysdeps/osf1/procstate.c4
1 files changed, 1 insertions, 3 deletions
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;