From 33be1ecfb1a9056b027d50d7b558cff87c5b744d Mon Sep 17 00:00:00 2001 From: KUDr Date: Thu, 11 Jan 2007 17:29:39 +0000 Subject: (svn r8066) - Codechange: MallocT(), CallocT(), ReallocT() now return the pointer to allocated memory instead of modifying the pointer given as parameter --- src/string.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/string.cpp') diff --git a/src/string.cpp b/src/string.cpp index 7e4aaf1d2..4556ac64b 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -59,12 +59,11 @@ char* CDECL str_fmt(const char* str, ...) char buf[4096]; va_list va; int len; - char* p; va_start(va, str); len = vsnprintf(buf, lengthof(buf), str, va); va_end(va); - MallocT(&p, len + 1); + char* p = MallocT(len + 1); if (p != NULL) memcpy(p, buf, len + 1); return p; } -- cgit v1.2.3-54-g00ecf