Signed-off-by: Michael Stefaniuc mstefani@winehq.org --- dlls/dpnet/address.c | 9 --------- dlls/mshtml/mshtml_private.h | 16 ---------------- dlls/wininet/internet.h | 15 --------------- include/wine/heap.h | 16 ++++++++++++++++ 4 files changed, 16 insertions(+), 40 deletions(-)
diff --git a/dlls/dpnet/address.c b/dlls/dpnet/address.c index 4d55caa47e..cfcc02289f 100644 --- a/dlls/dpnet/address.c +++ b/dlls/dpnet/address.c @@ -38,15 +38,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dpnet);
-static char *heap_strdupA( const char *str ) -{ - char *ret; - - if (!str) return NULL; - if ((ret = HeapAlloc( GetProcessHeap(), 0, strlen(str) + 1 ))) strcpy( ret, str ); - return ret; -} - static BOOL add_component(IDirectPlay8AddressImpl *This, struct component *item) { if(This->comp_count == This->comp_array_size) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 2b7018f38a..30c896e2d3 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -1205,22 +1205,6 @@ static inline LPWSTR heap_strndupW(LPCWSTR str, unsigned len) return ret; }
-static inline char *heap_strdupA(const char *str) -{ - char *ret = NULL; - - if(str) { - DWORD size; - - size = strlen(str)+1; - ret = heap_alloc(size); - if(ret) - memcpy(ret, str, size); - } - - return ret; -} - static inline WCHAR *heap_strdupAtoW(const char *str) { LPWSTR ret = NULL; diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index 736506a9ce..46501d776c 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -95,21 +95,6 @@ static inline void * __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem, size_t le return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len); }
-static inline char *heap_strdupA(const char *str) -{ - char *ret = NULL; - - if(str) { - DWORD size = strlen(str)+1; - - ret = heap_alloc(size); - if(ret) - memcpy(ret, str, size); - } - - return ret; -} - static inline LPWSTR heap_strndupW(LPCWSTR str, UINT max_len) { LPWSTR ret; diff --git a/include/wine/heap.h b/include/wine/heap.h index d970e03731..28fb9cc7c5 100644 --- a/include/wine/heap.h +++ b/include/wine/heap.h @@ -55,6 +55,22 @@ static inline void *heap_calloc(SIZE_T count, SIZE_T size) return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); }
+static inline char *heap_strdupA(const char *str) +{ + char *dst; + SIZE_T len; + + if(!str) + return NULL; + + len = strlen(str) + 1; + dst = heap_alloc(len); + if (dst) + memcpy(dst, str, len); + + return dst; +} + static inline WCHAR *heap_strdupW(const WCHAR *str) { WCHAR *dst;