Ver a proveniência
parser: Fail gracefully if a nonexistent file is passed on the command line
Before, if a nonexistent file was passed to LoadFileText(), it would
return NULL, and the parser would happily dereference it.
pull/2765/head
Peter0x44
há 2 anos
ascendente
cometimento
0a679d794a
Não foi encontrada uma chave conhecida para esta assinatura, na base de dados
ID da chave GPG: A8DEAD1A4BB82440
1 ficheiros alterados com
6 adições e
0 eliminações
-
parser/raylib_parser.c
|
|
@ -207,6 +207,12 @@ int main(int argc, char* argv[]) |
|
|
|
int length = 0; |
|
|
|
char *buffer = LoadFileText(inFileName, &length); |
|
|
|
|
|
|
|
if (buffer == NULL) |
|
|
|
{ |
|
|
|
printf("Could not read input file: %s\n", inFileName); |
|
|
|
return 1; |
|
|
|
} |
|
|
|
|
|
|
|
// Preprocess buffer to get separate lines |
|
|
|
// NOTE: GetTextLines() also removes leading spaces/tabs |
|
|
|
int linesCount = 0; |
|
|
|