properly terminate strings with NUL byte

This commit is contained in:
Lennart Poettering 2010-01-27 02:15:54 +01:00
parent f04fa1d5aa
commit 9164977dc6

View file

@ -250,7 +250,6 @@ void exec_command_free_array(ExecCommand **c, unsigned n) {
} }
} }
void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) { void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
assert(c); assert(c);
assert(f); assert(f);
@ -286,7 +285,7 @@ char *exec_command_line(ExecCommand *c) {
assert(c); assert(c);
assert(c->argv); assert(c->argv);
k = 0; k = 1;
STRV_FOREACH(a, c->argv) STRV_FOREACH(a, c->argv)
k += strlen(*a)+3; 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 /* FIXME: this doesn't really handle arguments that have
* spaces and ticks in them */ * spaces and ticks in them */