瀏覽代碼

Fixed 64bit bufferString bug

Thomas Buck 9 年之前
父節點
當前提交
8f1eb21507
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6
    1
      src/utils/strings.cpp

+ 6
- 1
src/utils/strings.cpp 查看文件

41
 
41
 
42
     text = new char[sz];
42
     text = new char[sz];
43
 
43
 
44
+    va_list copy;
45
+    va_copy(copy, args);
46
+
44
     n = vsnprintf(text, sz, string, args);
47
     n = vsnprintf(text, sz, string, args);
45
 
48
 
46
     if (n < 0) {
49
     if (n < 0) {
50
         sz = n + 1; // buffer too small
53
         sz = n + 1; // buffer too small
51
         delete [] text;
54
         delete [] text;
52
         text = new char[sz];
55
         text = new char[sz];
53
-        n = vsnprintf(text, sz, string, args);
56
+        n = vsnprintf(text, sz, string, copy);
54
     }
57
     }
55
 
58
 
59
+    va_end(copy);
60
+
56
     return text;
61
     return text;
57
 }
62
 }
58
 
63
 

Loading…
取消
儲存