From 5f883a80175a4cc9abda9d647a6a0d73bda84878 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Sun, 25 May 2025 00:25:01 -0300 Subject: move string utility to `util.cc` + small script identifier fix --- src/config.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/config.cc') diff --git a/src/config.cc b/src/config.cc index 0be4eec..e3e3c85 100644 --- a/src/config.cc +++ b/src/config.cc @@ -128,10 +128,8 @@ void ReadConfig(void){ return; } - // 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(); + char Identifier[MAX_IDENT_LENGTH]; + strcpy(Identifier, Script.readIdentifier()); Script.readSymbol('='); // TODO(fusion): Ughh... Get rid of all `strcpy`s. A malicious configuration -- cgit v1.2.3