From 85b0af8123c0eec0d472c304e3fee440beb7d2b9 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Wed, 19 Dec 2007 01:20:10 +0000 Subject: Add and use new functions for malloc+memcpy(+NUL-term) fragments. --- src/xine-utils/utils.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/xine-utils/utils.c') diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c index d9eb7fb3f..e6e997341 100644 --- a/src/xine-utils/utils.c +++ b/src/xine-utils/utils.c @@ -286,6 +286,19 @@ void *xine_xmalloc_aligned(size_t alignment, size_t size, void **base) { return ptr; } +void *xine_memdup (const void *src, size_t length) +{ + void *dst = malloc (length); + return xine_fast_memcpy (dst, src, length); +} + +void *xine_memdup0 (const void *src, size_t length) +{ + char *dst = xine_xmalloc (length + 1); + dst[length] = 0; + return xine_fast_memcpy (dst, src, length); +} + #ifdef WIN32 /* * Parse command line with Windows XP syntax and copy the command (argv[0]). -- cgit v1.2.3 From 9da4e2dde0da695c240cf48390217ac97cb10c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Wed, 19 Dec 2007 02:59:06 +0100 Subject: Update all the code to the new headers layout. --- src/xine-utils/utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/xine-utils/utils.c') diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c index d9eb7fb3f..5aff537b4 100644 --- a/src/xine-utils/utils.c +++ b/src/xine-utils/utils.c @@ -27,10 +27,10 @@ #include "config.h" #endif -#include "xineutils.h" -#include "xineintl.h" +#include +#include #ifdef _MSC_VER -#include "xine_internal.h" +#include #endif #include -- cgit v1.2.3