Commit d66f8e7b authored by Jim Meyering's avatar Jim Meyering Committed by Anthony Liguori
Browse files

vmdk: relative_path: use pstrcpy in place of strncpy



Avoid strncpy+manual-NUL-terminate.  Use pstrcpy instead.

Acked-by: default avatarKevin Wolf <kwolf@redhat.com>
Signed-off-by: default avatarJim Meyering <meyering@redhat.com>
Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
parent 3178e275
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1408,8 +1408,7 @@ static int relative_path(char *dest, int dest_size,
        return -1;
    }
    if (path_is_absolute(target)) {
        dest[dest_size - 1] = '\0';
        strncpy(dest, target, dest_size - 1);
        pstrcpy(dest, dest_size, target);
        return 0;
    }
    while (base[i] == target[i]) {