]> git.proxmox.com Git - mirror_lxcfs.git/blobdiff - bindings.c
bindings: even more concise must_strcat_pid
[mirror_lxcfs.git] / bindings.c
index 5394b44aa21cb2687fde41b3769207e98bd94d94..6e6be6eb3c09ba4fd87298fa32c3ad18202c433c 100644 (file)
@@ -1052,9 +1052,8 @@ static void must_strcat_pid(char **src, size_t *sz, size_t *asz, pid_t pid)
                *src = tmp;
                *asz += BUF_RESERVE_SIZE;
        }
-       memcpy((*src) +*sz , tmp, tmplen);
+       memcpy((*src) +*sz , tmp, tmplen+1); /* include the \0 */
        *sz += tmplen;
-       (*src)[*sz] = '\0';
 }
 
 /*