aboutsummaryrefslogtreecommitdiffstats
path: root/ll-database-binding
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-10-25 10:22:56 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-10-25 10:22:56 +0200
commit9df5caf58cb50dedf77d2bfa9cd1c4ecaa6151d6 (patch)
tree7d4fec73eff245a818b49e231431030fd582e2ea /ll-database-binding
parentd268229191ad11f0fd2534517a89422c1bb8e02c (diff)
database: fix bugs
Change-Id: I69b84976d48eaca56d6053750ab2b6445021b216 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'll-database-binding')
-rw-r--r--ll-database-binding/src/ll-database-binding.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ll-database-binding/src/ll-database-binding.c b/ll-database-binding/src/ll-database-binding.c
index c0fa939..524327f 100644
--- a/ll-database-binding/src/ll-database-binding.c
+++ b/ll-database-binding/src/ll-database-binding.c
@@ -68,7 +68,7 @@ static int get_database_path(char *buffer, size_t size)
config = secure_getenv("XDG_CONFIG_HOME");
if (config)
- rc = snprintf(buffer, size, "%s/.config/%s", home, dbfile);
+ rc = snprintf(buffer, size, "%s/%s", config, dbfile);
else
{
home = secure_getenv("HOME");
@@ -78,7 +78,7 @@ static int get_database_path(char *buffer, size_t size)
{
struct passwd *pwd = getpwuid(getuid());
if (pwd)
- rc = snprintf(buffer, size, "%s/.config/%s", result->pw_dir, dbfile);
+ rc = snprintf(buffer, size, "%s/.config/%s", pwd->pw_dir, dbfile);
else
rc = snprintf(buffer, size, "/home/%d/.config/%s", (int)getuid(), dbfile);
}