(svn r8066) - Codechange: MallocT(), CallocT(), ReallocT() now return the pointer to allocated memory instead of modifying the pointer given as parameter

This commit is contained in:
KUDr
2007-01-11 17:29:39 +00:00
parent 91ff746410
commit 33be1ecfb1
49 changed files with 141 additions and 181 deletions

View File

@@ -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<char>(len + 1);
if (p != NULL) memcpy(p, buf, len + 1);
return p;
}