aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--driver.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/driver.c b/driver.c
index 86622068..3032433e 100644
--- a/driver.c
+++ b/driver.c
@@ -868,8 +868,13 @@ int num; /* index of message */
strcat(names, idp->id);
strcat(names, " ");
}
- cmd = (char *)alloca(strlen(ctl->mda) + length);
+ length += strlen(ctl->mda);
+ cmd = (char *)alloca(length);
+#ifdef SNPRINTF
+ snprintf(cmd, length, ctl->mda, names);
+#else
sprintf(cmd, ctl->mda, names);
+#endif /* SNPRINTF */
if (outlevel == O_VERBOSE)
error(0, 0, "about to deliver with: %s", cmd);