]> git.proxmox.com Git - qemu.git/blobdiff - os-posix.c
Merge branch 'trivial-patches' of git://github.com/stefanha/qemu
[qemu.git] / os-posix.c
index 178e7caa4a257c716c7bd4c7aa1c2df9b7a8a0c5..488e48005f5330bcc59e442bdcf5e02e594fa9de 100644 (file)
@@ -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)) {