Welcome to little lamb

Code » anopa » commit 48a291d

start/stop: Fix missing details on failed exec

author Olivier Brunel
2018-01-23 18:03:01 UTC
committer Olivier Brunel
2018-01-24 21:29:17 UTC
parent fe0831af1ada283e22ea77cdf17af6684d593331

start/stop: Fix missing details on failed exec

When adding the filename we included the NUL byte, and added AFTER the
details of the failure, so it was never displayed.

Also remove the leading space, since that's not needed.

src/libanopa/exec_oneshot.c +2 -3

diff --git a/src/libanopa/exec_oneshot.c b/src/libanopa/exec_oneshot.c
index 900c0cc..b07557a 100644
--- a/src/libanopa/exec_oneshot.c
+++ b/src/libanopa/exec_oneshot.c
@@ -289,9 +289,8 @@ _exec_oneshot (int si, aa_mode mode)
                 if (c == 'e')
                 {
                     s->st.code = ERR_EXEC;
-                    byte_copy (msg, 1, " ");
-                    byte_copy (msg + 1, l_fn, filename);
-                    p += 1 + l_fn;
+                    byte_copy (msg, l_fn - 1, filename);
+                    p += l_fn - 1;
                 }
                 else if (c == 'p')
                     s->st.code = ERR_PIPES;