mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-21 10:48:15 +00:00
Some naming tweaks
This commit is contained in:
14
src/rlgl.h
14
src/rlgl.h
@@ -4915,21 +4915,21 @@ char *LoadFileText(const char *fileName)
|
||||
|
||||
if (fileName != NULL)
|
||||
{
|
||||
FILE *textFile = fopen(fileName, "rt");
|
||||
FILE *file = fopen(fileName, "rt");
|
||||
|
||||
if (textFile != NULL)
|
||||
if (file != NULL)
|
||||
{
|
||||
// WARNING: When reading a file as 'text' file,
|
||||
// text mode causes carriage return-linefeed translation...
|
||||
// ...but using fseek() should return correct byte-offset
|
||||
fseek(textFile, 0, SEEK_END);
|
||||
int size = ftell(textFile);
|
||||
fseek(textFile, 0, SEEK_SET);
|
||||
fseek(file, 0, SEEK_END);
|
||||
int size = ftell(file);
|
||||
fseek(file, 0, SEEK_SET);
|
||||
|
||||
if (size > 0)
|
||||
{
|
||||
text = (char *)RL_MALLOC((size + 1)*sizeof(char));
|
||||
int count = (int)fread(text, sizeof(char), size, textFile);
|
||||
int count = (int)fread(text, sizeof(char), size, file);
|
||||
|
||||
// WARNING: \r\n is converted to \n on reading, so,
|
||||
// read bytes count gets reduced by the number of lines
|
||||
@@ -4942,7 +4942,7 @@ char *LoadFileText(const char *fileName)
|
||||
}
|
||||
else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to read text file", fileName);
|
||||
|
||||
fclose(textFile);
|
||||
fclose(file);
|
||||
}
|
||||
else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to open text file", fileName);
|
||||
}
|
||||
|
Reference in New Issue
Block a user