summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-27 02:15:54 +0100
committerLennart Poettering <lennart@poettering.net>2010-01-27 02:15:54 +0100
commit9164977dc65aa6396cb49611f38f2d423e120bc7 (patch)
tree204560bc4a178dd8ecb5361d8547134c6530145a
parentf04fa1d5aa4ae76c6e95b986834b4223f51527b3 (diff)
properly terminate strings with NUL byte
-rw-r--r--execute.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/execute.c b/execute.c
index bcaa4e959d..518d7a6b0a 100644
--- a/execute.c
+++ b/execute.c
@@ -250,7 +250,6 @@ void exec_command_free_array(ExecCommand **c, unsigned n) {
}
}
-
void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
assert(c);
assert(f);
@@ -286,7 +285,7 @@ char *exec_command_line(ExecCommand *c) {
assert(c);
assert(c->argv);
- k = 0;
+ k = 1;
STRV_FOREACH(a, c->argv)
k += strlen(*a)+3;
@@ -310,6 +309,8 @@ char *exec_command_line(ExecCommand *c) {
}
+ *p = 0;
+
/* FIXME: this doesn't really handle arguments that have
* spaces and ticks in them */