mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
config: include: use xasprintf() instead of two calls to snprintf()
This commit is contained in:
parent
ed855c72dc
commit
8f307178df
1 changed files with 1 additions and 3 deletions
4
config.c
4
config.c
|
|
@ -657,9 +657,7 @@ parse_section_main(const char *key, const char *value, struct config *conf,
|
|||
return false;
|
||||
}
|
||||
|
||||
int chars = snprintf(NULL, 0, "%s/%s", home_dir, &value[2]);
|
||||
_include_path = malloc(chars + 1);
|
||||
snprintf(_include_path, chars + 1, "%s/%s", home_dir, &value[2]);
|
||||
_include_path = xasprintf("%s/%s", home_dir, value + 2);
|
||||
include_path = _include_path;
|
||||
} else
|
||||
include_path = value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue