New function xdup.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3723 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2000-2003 Ullrich von Bassewitz */
|
||||
/* (C) 2000-2006 Ullrich von Bassewitz */
|
||||
/* R<>merstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
/* common */
|
||||
#include "abend.h"
|
||||
#include "debugflag.h"
|
||||
@@ -120,4 +120,11 @@ char* xstrdup (const char* S)
|
||||
|
||||
|
||||
|
||||
void* xdup (const void* Buf, size_t Size)
|
||||
/* Create a copy of Buf on the heap and return a pointer to it. */
|
||||
{
|
||||
return memcpy (xmalloc (Size), Buf, Size);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user