mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Use line.reserve in sdobj_ReadFile instead of constructor
Passing a count parameter to the vector constructor does not reserve count elements but instead fills the vector with count elements. This caused the endianness check to fail first because the first 256 characters were null bytes.
This commit is contained in:
committed by
Eldred Habert
parent
589cea47f6
commit
379aa8c267
@@ -136,7 +136,8 @@ enum RelocFlags {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void sdobj_ReadFile(FileStackNode const &where, FILE *file, std::vector<Symbol> &fileSymbols) {
|
void sdobj_ReadFile(FileStackNode const &where, FILE *file, std::vector<Symbol> &fileSymbols) {
|
||||||
std::vector<char> line(256);
|
std::vector<char> line;
|
||||||
|
line.reserve(256);
|
||||||
char const *token;
|
char const *token;
|
||||||
|
|
||||||
#define getToken(ptr, ...) \
|
#define getToken(ptr, ...) \
|
||||||
|
|||||||
Reference in New Issue
Block a user