浏览代码

stb.h: fix bug in stb_readdir caused by change to stb_strncpy

Sean Barrett 4 年之前
父节点
当前提交
95372dc4f8
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      deprecated/stb.h

+ 1 - 0
deprecated/stb.h

@@ -9230,6 +9230,7 @@ int stb__wildmatch_raw(char *expr, char *candidate, int search, int insensitive)
       // need to allow for non-writeable strings... assume they're small
       if (s - last < 256) {
          stb_strncpy(buffer, last, (int) (s-last+1));
+         buffer[s-last] = 0;
          z = stb__wildmatch_raw2(buffer, candidate, search, insensitive);
       } else {
          *s = 0;