Ver código fonte

Remove warning from GetDirectoryPath()

pull/1271/head
raysan5 5 anos atrás
pai
commit
5d0b2c796e
1 arquivos alterados com 1 adições e 1 exclusões
  1. +1
    -1
      src/core.c

+ 1
- 1
src/core.c Ver arquivo

@ -2111,7 +2111,7 @@ const char *GetDirectoryPath(const char *filePath)
if (lastSlash) if (lastSlash)
{ {
// 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'
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 dirPath[strlen(filePath) - strlen(lastSlash) + ((filePath[1] != ':')? 2 : 0)] = '\0'; // Add '\0' manually
} }

Carregando…
Cancelar
Salvar