浏览代码

GetDirectoryPath: return NULL, don't crash when no slash

Noted in #634.
pull/635/head
Ahmad Fatoum 7 年前
父节点
当前提交
85213795d1
找不到此签名对应的密钥 GPG 密钥 ID: C3EAC3DE9321D59B
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. +3
    -0
      src/core.c

+ 3
- 0
src/core.c 查看文件

@ -1374,6 +1374,9 @@ const char *GetDirectoryPath(const char *fileName)
memset(filePath, 0, 256);
lastSlash = strprbrk(fileName, "\\/");
if (!lastSlash)
return NULL;
strncpy(filePath, fileName, strlen(fileName) - (strlen(lastSlash) - 1));
filePath[strlen(fileName) - strlen(lastSlash)] = '\0';

正在加载...
取消
保存