mirror of
https://github.com/Relintai/sfw.git
synced 2024-11-08 07:52:09 +01:00
Fix handling null terminator.
This commit is contained in:
parent
acff200ac1
commit
ce56ea2724
@ -16,7 +16,7 @@ String FileAccess::read_file(const String &path) {
|
||||
fseek(f, 0, SEEK_SET); /* same as rewind(f); */
|
||||
|
||||
CharString cs;
|
||||
cs.resize(fsize);
|
||||
cs.resize(fsize + 1); // +1 for the null terminator
|
||||
|
||||
fread(cs.ptrw(), 1, fsize, f);
|
||||
fclose(f);
|
||||
|
Loading…
Reference in New Issue
Block a user