summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2014-07-27 10:53:03 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2014-07-27 10:58:00 +0200
commit3fe99420177809180ccd3d6cf117b37fe8d6f9bc (patch)
tree3a7ce2b1accd4d99d16f2e3148dfaed697ed841a
parentf52ca8fe12e82ccc95f6498b29c7ccaeaf839b86 (diff)
downloadcalcurse-3fe99420177809180ccd3d6cf117b37fe8d6f9bc.tar.gz
calcurse-3fe99420177809180ccd3d6cf117b37fe8d6f9bc.zip
Fix find_basedir() and display_help()
Fixes two regressions introduced in 21fc7a4 (Replace several uses of snprintf() by asprintf(), 2014-07-21). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
-rw-r--r--src/help.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/help.c b/src/help.c
index fe144f4..13a49fc 100644
--- a/src/help.c
+++ b/src/help.c
@@ -72,7 +72,7 @@ static int find_basedir(const char *locale_info[], unsigned n, char **basedir)
}
mem_free(*basedir);
- basedir = NULL;
+ *basedir = NULL;
mem_free(locale);
locale = NULL;
}
@@ -98,10 +98,8 @@ int display_help(const char *topic)
if (!topic)
topic = "intro";
- if (!find_basedir(locale_info, ARRAY_SIZE(locale_info), &basedir)) {
- mem_free(basedir);
+ if (!find_basedir(locale_info, ARRAY_SIZE(locale_info), &basedir))
asprintf(&basedir, "%s", DOCDIR);
- }
asprintf(&path, "%s/%s.txt", basedir, topic);