chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f04fa1d
)
properly terminate strings with NUL byte
author
Lennart Poettering
<lennart@poettering.net>
Wed, 27 Jan 2010 01:15:54 +0000
(
02:15
+0100)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 27 Jan 2010 01:15:54 +0000
(
02:15
+0100)
execute.c
patch
|
blob
|
history
diff --git
a/execute.c
b/execute.c
index bcaa4e959d580c0d3ed65a9f5615b1e2367f416d..518d7a6b0a0a3cbb6f3353d48c28889623b05b0d 100644
(file)
--- 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);
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);
assert(c);
assert(c->argv);
- k =
0
;
+ k =
1
;
STRV_FOREACH(a, c->argv)
k += strlen(*a)+3;
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 */
/* FIXME: this doesn't really handle arguments that have
* spaces and ticks in them */