From 5d0b2c796e09ab4adc09bc2fb68a7a5d3e51a911 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 7 Jun 2020 11:50:03 +0200 Subject: [PATCH] Remove warning from GetDirectoryPath() --- src/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.c b/src/core.c index c50cd5599..bb29c2b9c 100644 --- a/src/core.c +++ b/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 }