From e78e80dd06d72fef84d856bfbb12f8c3a0bf290b Mon Sep 17 00:00:00 2001 From: kevin Date: Sat, 13 Jul 2013 17:21:12 -0700 Subject: [PATCH] cmMallocDebug.c:Fixed bug in cmMdAllocStr() where terminating zero was not always inserted. --- cmMallocDebug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cmMallocDebug.c b/cmMallocDebug.c index 9c1264d..df69020 100644 --- a/cmMallocDebug.c +++ b/cmMallocDebug.c @@ -54,6 +54,7 @@ cmChar_t* cmMdAllocStr( void* orgStrPtr, const cmChar_t* str, unsigned n, u n += 1; cmChar_t* cp = cmMdAllocate(orgStrPtr,n,sizeof(cmChar_t),flags); strncpy(cp,str,n); + cp[n-1] = 0; return cp; }