Procházet zdrojové kódy

GetDirectoryPath: return NULL, don't crash when no slash

Noted in #634.
pull/635/head
Ahmad Fatoum před 7 roky
rodič
revize
85213795d1
V databázi nebyl nalezen žádný známý klíč pro tento podpis ID GPG klíče: C3EAC3DE9321D59B
1 změnil soubory, kde provedl 3 přidání a 0 odebrání
  1. +3
    -0
      src/core.c

+ 3
- 0
src/core.c Zobrazit soubor

@ -1374,6 +1374,9 @@ const char *GetDirectoryPath(const char *fileName)
memset(filePath, 0, 256);
lastSlash = strprbrk(fileName, "\\/");
if (!lastSlash)
return NULL;
strncpy(filePath, fileName, strlen(fileName) - (strlen(lastSlash) - 1));
filePath[strlen(fileName) - strlen(lastSlash)] = '\0';

Načítá se…
Zrušit
Uložit