瀏覽代碼

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

always inserted.
master
kevin 11 年之前
父節點
當前提交
e78e80dd06
共有 1 個檔案被更改,包括 1 行新增0 行删除
  1. 1
    0
      cmMallocDebug.c

+ 1
- 0
cmMallocDebug.c 查看文件

@@ -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…
取消
儲存