Browse Source

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

always inserted.
master
kevin 11 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
   n += 1;
54
   n += 1;
55
   cmChar_t* cp = cmMdAllocate(orgStrPtr,n,sizeof(cmChar_t),flags);
55
   cmChar_t* cp = cmMdAllocate(orgStrPtr,n,sizeof(cmChar_t),flags);
56
   strncpy(cp,str,n);
56
   strncpy(cp,str,n);
57
+  cp[n-1] = 0;
57
   return cp;
58
   return cp;
58
 }
59
 }
59
 
60
 

Loading…
Cancel
Save