mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-01 11:06:44 +01:00
allocate string buffer when appending new config option at runtime
This commit is contained in:
parent
6b877d10a2
commit
654472f79a
1 changed files with 3 additions and 0 deletions
|
@ -37,6 +37,9 @@ struct ConfigOption *config;
|
||||||
void AppendToConfig(char* section, char* name, char* value) {
|
void AppendToConfig(char* section, char* name, char* value) {
|
||||||
struct ConfigOption *new = malloc(sizeof(struct ConfigOption));
|
struct ConfigOption *new = malloc(sizeof(struct ConfigOption));
|
||||||
new->next = NULL;
|
new->next = NULL;
|
||||||
|
new->section = malloc(sizeof(char)*255);
|
||||||
|
new->name = malloc(sizeof(char)*255);
|
||||||
|
new->value = malloc(sizeof(char)*255);
|
||||||
strcpy(new->section, section);
|
strcpy(new->section, section);
|
||||||
strcpy(new->name, name);
|
strcpy(new->name, name);
|
||||||
strcpy(new->value, value);
|
strcpy(new->value, value);
|
||||||
|
|
Loading…
Reference in a new issue