Fixed arguments to sprintf when constructing the expansion of %*. Found by Maurizio De Tommaso.

This commit is contained in:
Mark Pizzolato 2012-04-12 12:18:23 -07:00
parent 79d0e25848
commit c6c9e0c3ac

2
scp.c
View file

@ -1286,7 +1286,7 @@ for (; *ip && (op < oend); ) {
char quote = '"';
if (strchr(do_arg[i], quote))
quote = '\'';
sprintf(&rbuf[strlen(rbuf)], "%s%s\"", (i != 1) ? " " : "", quote, do_arg[i], quote);
sprintf(&rbuf[strlen(rbuf)], "%s%s%s%s\"", (i != 1) ? " " : "", quote, do_arg[i], quote);
}
else
sprintf(&rbuf[strlen(rbuf)], "%s%s", (i != 1) ? " " : "", do_arg[i]);