OSDN Git Service
(root)
/
qmiga
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3178e27
)
vmdk: relative_path: use pstrcpy in place of strncpy
author
Jim Meyering
<meyering@redhat.com>
Thu, 4 Oct 2012 11:09:48 +0000
(13:09 +0200)
committer
Anthony Liguori
<aliguori@us.ibm.com>
Fri, 5 Oct 2012 12:58:36 +0000
(07:58 -0500)
Avoid strncpy+manual-NUL-terminate. Use pstrcpy instead.
Acked-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block/vmdk.c
patch
|
blob
|
history
diff --git
a/block/vmdk.c
b/block/vmdk.c
index
f2e861b
..
1a80e5a
100644
(file)
--- a/
block/vmdk.c
+++ b/
block/vmdk.c
@@
-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]) {