aboutsummaryrefslogtreecommitdiff
path: root/src/core.c
diff options
context:
space:
mode:
authorRay <raysan5@gmail.com>2018-10-10 23:55:36 +0200
committerRay <raysan5@gmail.com>2018-10-10 23:55:36 +0200
commit126ab49221ff4cc988ed83efc110d88e96c7f962 (patch)
tree52f5b69d58f840389519bf68ea8a5c455f53c794 /src/core.c
parent64778e8cd898c9d03b188853343af1369cfd0ddc (diff)
downloadraylib-126ab49221ff4cc988ed83efc110d88e96c7f962.tar.gz
raylib-126ab49221ff4cc988ed83efc110d88e96c7f962.zip
Minor tweaks
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core.c b/src/core.c
index 37772e7e..e99b24b5 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1569,8 +1569,9 @@ const char *GetDirectoryPath(const char *fileName)
lastSlash = strprbrk(fileName, "\\/");
if (!lastSlash) return NULL;
+ // NOTE: Be careful, strncpy() is not safe, it does not care about '\0'
strncpy(filePath, fileName, strlen(fileName) - (strlen(lastSlash) - 1));
- filePath[strlen(fileName) - strlen(lastSlash)] = '\0';
+ filePath[strlen(fileName) - strlen(lastSlash)] = '\0'; // Add '\0' manually
return filePath;
}