From 3f557369c7bbd08fdf2e6dbd9271873b20a9a144 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Sat, 24 May 2025 20:57:24 -0300 Subject: halfway of `map.cc` and start of `objects.cc` --- src/config.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/config.cc') diff --git a/src/config.cc b/src/config.cc index bae583a..0be4eec 100644 --- a/src/config.cc +++ b/src/config.cc @@ -128,14 +128,10 @@ void ReadConfig(void){ return; } - // TODO(fusion): Probably some `expectIdentifier` function inlined? - // It seems `getIdentifier` also does the same check so this one is - // redundant? - if(Script.Token != IDENTIFIER){ - Script.error("Identifier expected"); - } - - char *Identifier = Script.getIdentifier(); + // TODO(fusion): If the following `readSymbol` calls `nextToken`, then the + // buffer the identifier is in will get wiped. (UPDATE: Yes, the original + // version copies it into a local stack buffer, lol.) + const char *Identifier = Script.readIdentifier(); Script.readSymbol('='); // TODO(fusion): Ughh... Get rid of all `strcpy`s. A malicious configuration -- cgit v1.2.3