Navigation Menu

Skip to content

Commit

Permalink
ipconfig: Use prefix in store_{set|get}_int()
Browse files Browse the repository at this point in the history
The prefix/key pair should be used when writing or reading the integer
values.

Fixes: e72c871 ("ipconfig: Refactor keyfile store and load operations")
  • Loading branch information
igaw authored and ballock committed Apr 21, 2021
1 parent e9ae1e7 commit 520a395
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions connman/src/ipconfig.c
Expand Up @@ -163,7 +163,7 @@ static void store_set_int(struct ipconfig_store *store,
return;

pk = g_strdup_printf("%s%s", store->prefix, key);
g_key_file_set_integer(store->file, store->group, key, val);
g_key_file_set_integer(store->file, store->group, pk, val);
g_free(pk);
}

Expand All @@ -173,7 +173,7 @@ static int store_get_int(struct ipconfig_store *store, const char *key)
char *pk;

pk = g_strdup_printf("%s%s", store->prefix, key);
val = g_key_file_get_integer(store->file, store->group, key, 0);
val = g_key_file_get_integer(store->file, store->group, pk, 0);
g_free(pk);

return val;
Expand Down

0 comments on commit 520a395

Please sign in to comment.