From 59bbd4658fb1aaf839c8dc2545799e8cbfcbcb35 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Tue, 30 Jul 2013 10:08:48 -0400 Subject: [PATCH] man/stap.1: small correction This correction might be useful for those who want to parse the output. Also add a small comment in stapsh.c to clarify the STAPSH_MAX_ARGS comparison. --- man/stap.1 | 2 +- staprun/stapsh.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/man/stap.1 b/man/stap.1 index 193731bfa..5bde9bb77 100644 --- a/man/stap.1 +++ b/man/stap.1 @@ -540,7 +540,7 @@ URL is available as a special loopback mode to run on the local host. .TP .BI \-\-remote\-prefix -Prefix each line of remote output with "N:", where N is the index of the remote +Prefix each line of remote output with "N: ", where N is the index of the remote execution target from which the given line originated. .TP diff --git a/staprun/stapsh.c b/staprun/stapsh.c index b65b75ffc..dbfac4c94 100644 --- a/staprun/stapsh.c +++ b/staprun/stapsh.c @@ -337,6 +337,8 @@ do_run() char* arg; while ((arg = strtok(NULL, STAPSH_TOK_DELIM))) { + // check if we have space left + // note that we have to keep at least one 0 at the end for posix_spawn if (nargs + 1 > STAPSH_MAX_ARGS) return reply ("ERROR: too many arguments\n"); if (qpdecode(arg) != 0) -- 2.43.5