diff options
| author | Ray <[email protected]> | 2023-10-09 00:47:22 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2023-10-09 00:47:22 +0200 |
| commit | df8d3a5afb6bec908ad0e720a1cbb2b444cb951d (patch) | |
| tree | 78d17cd91b5c54a7fe9dd0d8249a738e76c54c6f | |
| parent | d445fdaa199eae6540621b5a35f2d498f5ffab5c (diff) | |
| download | raylib-df8d3a5afb6bec908ad0e720a1cbb2b444cb951d.tar.gz raylib-df8d3a5afb6bec908ad0e720a1cbb2b444cb951d.zip | |
REVIEWED: Some warnings #3313
| -rw-r--r-- | src/rcore.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rcore.c b/src/rcore.c index f28aff74..85a84f59 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -1413,10 +1413,10 @@ const char *GetDirectoryPath(const char *filePath) else { // NOTE: Be careful, strncpy() is not safe, it does not care about '\0' - unsigned char *dirPathPtr = dirPath; + char *dirPathPtr = dirPath; if ((filePath[1] != ':') && (filePath[0] != '\\') && (filePath[0] != '/')) dirPathPtr += 2; // Skip drive letter, "C:" memcpy(dirPathPtr, filePath, strlen(filePath) - (strlen(lastSlash) - 1)); - dirPath[strlen(filePath) - strlen(lastSlash) + ((filePath[1] != ':') && (filePath[0] != '\\') && (filePath[0] != '/'))? 2 : 0] = '\0'; // Add '\0' manually + dirPath[strlen(filePath) - strlen(lastSlash) + (((filePath[1] != ':') && (filePath[0] != '\\') && (filePath[0] != '/'))? 2 : 0)] = '\0'; // Add '\0' manually } } |
