Преглед на файлове

REVIEWED: Some warnings #3313

pull/3392/head
Ray преди 1 година
родител
ревизия
df8d3a5afb
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. +2
    -2
      src/rcore.c

+ 2
- 2
src/rcore.c Целия файл

@ -1413,10 +1413,10 @@ const char *GetDirectoryPath(const char *filePath)
else else
{ {
// NOTE: Be careful, strncpy() is not safe, it does not care about '\0' // 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:" if ((filePath[1] != ':') && (filePath[0] != '\\') && (filePath[0] != '/')) dirPathPtr += 2; // Skip drive letter, "C:"
memcpy(dirPathPtr, filePath, strlen(filePath) - (strlen(lastSlash) - 1)); 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) + ((p">(filePath[1] != ':') && (filePath[0] != '\\') && (filePath[0] != '/'))? 2 : 0)] = '\0'; // Add '\0' manually
} }
} }

Зареждане…
Отказ
Запис