Browse Source

fix: stdin的buffer预留NUL位

SongZihuan 3 năm trước cách đây
mục cha
commit
57cc4761ab
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/tool/stdio_.c

+ 1 - 1
src/tool/stdio_.c

@@ -27,7 +27,7 @@
 // cygwin环境下, 终端默认为uft-8
 
 #define BUFF_SIZE (40960)
-static char buffer[BUFF_SIZE] = "";
+static char buffer[BUFF_SIZE + 1] = "";
 static size_t index = 0;
 static size_t next = 0;
 static size_t end = 0;