aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmd2.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd2.c b/cmd2.c
index 06892ed..fda5694 100644
--- a/cmd2.c
+++ b/cmd2.c
@@ -216,10 +216,10 @@ void parse_alias __P1 (char *,str)
if (*np) {
char buf[BUFSIZE];
escape_specials(buf, left);
- sprintf(inserted_next, "#alias %s%.*s@%s=%.*s",
- BUFSIZE-9, buf,
- (*np)->group == NULL ? "*" : (*np)->group,
- BUFSIZE-(int)strlen(buf)-9, (*np)->subst);
+ snprintf(inserted_next, BUFSIZE, "#alias %s@%s=%s",
+ buf,
+ (*np)->group == NULL ? "*" : (*np)->group,
+ (*np)->subst);
} else {
PRINTF("#unknown alias, cannot show: \"%s\"\n", left);
}