Fix error introduced by r5044
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
Mon, 25 Aug 2008 20:03:28 +0000 (20:03 +0000)
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
Mon, 25 Aug 2008 20:03:28 +0000 (20:03 +0000)
qemu_strdup() doesn't copy a last character because of off by one error.

Signed-off-by: Gleb Natapov <gleb@qumranet.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5086 c046a42c-6fe2-441c-8c8c-71466251a162

qemu-malloc.c

index 8ad616847a04930931ba8510f91cf4ca9f2065ad..3bffae1fbb0384384f5391e13766b8b9e1623afb 100644 (file)
@@ -60,6 +60,6 @@ char *qemu_strdup(const char *str)
     ptr = qemu_malloc(len + 1);
     if (!ptr)
         return NULL;
-    pstrcpy(ptr, len, str);
+    pstrcpy(ptr, len + 1, str);
     return ptr;
 }