#include "utils.h"
#include "paths.h"
+#include "utils.h"
enum resolve_name_direction {
LEFT_TO_RIGHT,
char *
get_home_xcompose_file_path(void)
{
- int ret;
const char *home;
- char *path;
home = secure_getenv("HOME");
if (!home)
return NULL;
- ret = asprintf(&path, "%s/.XCompose", home);
- if (ret <0)
- return NULL;
-
- return path;
+ return asprintf_safe("%s/.XCompose", home);
}
char *
}
else {
const char *xlocaledir = get_xlocaledir_path();
- int ret = asprintf(&path, "%s/%s", xlocaledir, resolved);
+ path = asprintf_safe("%s/%s", xlocaledir, resolved);
free(resolved);
- if (ret < 0)
- return NULL;
}
return path;