aboutsummaryrefslogtreecommitdiff
path: root/qemu-malloc.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-08-21 17:58:08 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-08-21 17:58:08 +0000
commit363a37d52016e0a16e3599d690f610346fc6898a (patch)
tree35ce1129736b9c6833c2e5eda5c6015b7897c67f /qemu-malloc.c
parentc93e7817ee963d9441f6706d6f194ff02cec690f (diff)
Fix OpenBSD linker warnings
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5044 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'qemu-malloc.c')
-rw-r--r--qemu-malloc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/qemu-malloc.c b/qemu-malloc.c
index 606eda6ff0..8ad616847a 100644
--- a/qemu-malloc.c
+++ b/qemu-malloc.c
@@ -56,9 +56,10 @@ void *qemu_mallocz(size_t size)
char *qemu_strdup(const char *str)
{
char *ptr;
- ptr = qemu_malloc(strlen(str) + 1);
+ size_t len = strlen(str);
+ ptr = qemu_malloc(len + 1);
if (!ptr)
return NULL;
- strcpy(ptr, str);
+ pstrcpy(ptr, len, str);
return ptr;
}