aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2023-12-10 01:05:06 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2023-12-10 01:05:06 -0500
commitd0ed95e9e54770972db247e197787ec611607cf1 (patch)
treedd486cd4aa6d0c72b2b599342c22f3838a94def4
parentc9a9073755537aec9024635147a74a1452b520cf (diff)
downloadstasis-d0ed95e9e54770972db247e197787ec611607cf1.tar.gz
Remove trailing whitespace from key name
-rw-r--r--src/ini.c6
1 files changed, 4 insertions, 2 deletions
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;
}