From d0ed95e9e54770972db247e197787ec611607cf1 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Sun, 10 Dec 2023 01:05:06 -0500 Subject: Remove trailing whitespace from key name --- src/ini.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ini.c b/src/ini.c index 6917063..96d602b 100644 --- a/src/ini.c +++ b/src/ini.c @@ -309,10 +309,12 @@ struct INIFILE *ini_open(const char *filename) { line[strlen(line) - 2] = '\0'; // Create new named section - ini_section_record(&ini, &line[1]); + strip(name); + ini_section_record(&ini, name); // Record the name of the section. This is used until another section is found. - strcpy(current_section, &line[1]); + strcpy(current_section, name); + guard_free(name) continue; } -- cgit