瀏覽代碼

Remove warning from GetDirectoryPath()

pull/1271/head
raysan5 5 年之前
父節點
當前提交
5d0b2c796e
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. +1
    -1
      src/core.c

+ 1
- 1
src/core.c 查看文件

@ -2111,7 +2111,7 @@ const char *GetDirectoryPath(const char *filePath)
if (lastSlash)
{
// NOTE: Be careful, strncpy() is not safe, it does not care about '\0'
strncpy(dirPath + ((filePath[1] != ':')? 2 : 0), filePath, strlen(filePath) - (strlen(lastSlash) - 1));
memcpy(dirPath + ((filePath[1] != ':')? 2 : 0), filePath, strlen(filePath) - (strlen(lastSlash) - 1));
dirPath[strlen(filePath) - strlen(lastSlash) + ((filePath[1] != ':')? 2 : 0)] = '\0'; // Add '\0' manually
}

Loading…
取消
儲存