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>
This commit is contained in:
parent
f52ca8fe12
commit
3fe9942017
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user