diff options
Diffstat (limited to 'shell.c')
-rw-r--r-- | shell.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -46,11 +46,7 @@ static int is_valid_cmd_name(const char *cmd) static char *make_cmd(const char *prog) { - char *prefix = xmalloc((strlen(prog) + strlen(COMMAND_DIR) + 2)); - strcpy(prefix, COMMAND_DIR); - strcat(prefix, "/"); - strcat(prefix, prog); - return prefix; + return xstrfmt("%s/%s", COMMAND_DIR, prog); } static void cd_to_homedir(void) |