Browse Source

cmMallocDebug.c:Fixed bug in cmMdAllocStr() where terminating zero was not

always inserted.
master
kevin 10 years ago
parent
commit
e78e80dd06
1 changed files with 1 additions and 0 deletions
  1. 1
    0
      cmMallocDebug.c

+ 1
- 0
cmMallocDebug.c View File

@@ -54,6 +54,7 @@ cmChar_t* cmMdAllocStr(      void* orgStrPtr, const cmChar_t* str, unsigned n, u
54 54
   n += 1;
55 55
   cmChar_t* cp = cmMdAllocate(orgStrPtr,n,sizeof(cmChar_t),flags);
56 56
   strncpy(cp,str,n);
57
+  cp[n-1] = 0;
57 58
   return cp;
58 59
 }
59 60
 

Loading…
Cancel
Save