Skip to contentSkip to conversation

[5086] Fix error introduced by r5044

Qemu-devel Blue Swirl 1 participant 1 message Aug 25, 2008

lore
Share & tools
lore

Blue Swirl

author
#0 lore raw

Revision: 5086

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5086
Author:   blueswir1
Date:     2008-08-25 20:03:28 +0000 (Mon, 25 Aug 2008)

Log Message:
-----------
Fix error introduced by r5044

qemu_strdup() doesn't copy a last character because of off by one error.

Modified Paths:
--------------
trunk/qemu-malloc.c

Modified: trunk/qemu-malloc.c
===================================================================

qemu-malloc.c +1 -1
@@ -60,6 +60,6 @@
     ptr = qemu_malloc(len + 1);
     if (!ptr)
         return NULL;
-    pstrcpy(ptr, len, str);
+    pstrcpy(ptr, len + 1, str);
     return ptr;
 }