diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-07-14 17:21:57 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-07-14 17:21:57 +0000 |
commit | 2571929a77c2d1c77c9fd28341994eb69acda7b6 (patch) | |
tree | d7aaa72b62d36ef87cd2322e6308ce10ba1e8f1a /osdep.c | |
parent | completion support (diff) | |
download | qemu-kvm-2571929a77c2d1c77c9fd28341994eb69acda7b6.tar.gz qemu-kvm-2571929a77c2d1c77c9fd28341994eb69acda7b6.tar.bz2 qemu-kvm-2571929a77c2d1c77c9fd28341994eb69acda7b6.zip |
added qemu_strdup()
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1021 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'osdep.c')
-rw-r--r-- | osdep.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -294,6 +294,16 @@ void *qemu_mallocz(size_t size) return ptr; } +char *qemu_strdup(const char *str) +{ + char *ptr; + ptr = qemu_malloc(strlen(str) + 1); + if (!ptr) + return NULL; + strcpy(ptr, str); + return ptr; +} + /****************************************************************/ /* printf support */ |