aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--os-posix.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/os-posix.c b/os-posix.c
index eabccb8fe0..f855abb09a 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -148,8 +148,7 @@ void os_set_proc_name(const char *s)
char name[16];
if (!s)
return;
- name[sizeof(name) - 1] = 0;
- strncpy(name, s, sizeof(name));
+ pstrcpy(name, sizeof(name), s);
/* Could rewrite argv[0] too, but that's a bit more complicated.
This simple way is enough for `top'. */
if (prctl(PR_SET_NAME, name)) {