Skip to content

Commit 2ec98c1

Browse files
author
Bjarne Loft
committed
When updating an existing value, update that value instread of the first value
1 parent a9951d0 commit 2ec98c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Config.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ char * Config::set(const char *key, const char *value){
8585
while(ele) {
8686
if(strcmp(key, ele->key) == 0) {
8787
free(ele->value);
88-
elements->value = (char*)malloc(strlen(value)+1);
89-
strcpy(elements->value, value);
88+
ele->value = (char*)malloc(strlen(value)+1);
89+
strcpy(ele->value, value);
9090
return ele->value;
9191
}
9292
ele = ele->next;

0 commit comments

Comments
 (0)