mirror of
https://github.com/qemu/qemu.git
synced 2024-11-27 22:03:35 +08:00
added qemu_strdup()
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1021 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
81d0912d2d
commit
2571929a77
10
osdep.c
10
osdep.c
@ -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 */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user