浏览代码

fix: stdin的buffer预留NUL位

SongZihuan 3 年之前
父节点
当前提交
57cc4761ab
共有 1 个文件被更改,包括 1 次插入1 次删除
  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;