introduce sasprintf() in libi3, use it everywhere

This commit is contained in:
Michael Stapelberg
2011-10-23 13:16:56 +01:00
parent 14abafb3c8
commit 9d15a00ba8
18 changed files with 68 additions and 66 deletions

View File

@ -196,8 +196,7 @@ static char *get_config_path(const char *override_configpath) {
xdg_config_home = "~/.config";
xdg_config_home = resolve_tilde(xdg_config_home);
if (asprintf(&config_path, "%s/i3/config", xdg_config_home) == -1)
die("asprintf() failed");
sasprintf(&config_path, "%s/i3/config", xdg_config_home);
free(xdg_config_home);
if (path_exists(config_path))
@ -217,8 +216,7 @@ static char *get_config_path(const char *override_configpath) {
char *tok = strtok(buf, ":");
while (tok != NULL) {
tok = resolve_tilde(tok);
if (asprintf(&config_path, "%s/i3/config", tok) == -1)
die("asprintf() failed");
sasprintf(&config_path, "%s/i3/config", tok);
free(tok);
if (path_exists(config_path)) {
free(buf);