diff options
author | Amadeusz Pawlik <apawlik@protonmail.com> | 2019-10-26 20:06:48 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-10-28 09:08:53 -0400 |
commit | ec7a6757ecdff7d6680fca42aba2802bc298e21a (patch) | |
tree | 58e5e15bed40b0843facdb93e21baa2052f7d156 /src/feature | |
parent | 2edda444da8d66cbbe86af3c97352ab9b89d651d (diff) | |
download | tor-ec7a6757ecdff7d6680fca42aba2802bc298e21a.tar.gz tor-ec7a6757ecdff7d6680fca42aba2802bc298e21a.zip |
Removes trailing spaces in control event log
Diffstat (limited to 'src/feature')
-rw-r--r-- | src/feature/control/control_events.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/feature/control/control_events.c b/src/feature/control/control_events.c index 2970745ca0..57cfb0d026 100644 --- a/src/feature/control/control_events.c +++ b/src/feature/control/control_events.c @@ -1385,6 +1385,16 @@ control_event_logmsg(int severity, log_domain_mask_t domain, const char *msg) for (cp = b; *cp; ++cp) if (*cp == '\r' || *cp == '\n') *cp = ' '; + + /* Remove trailing spaces */ + for (--cp; *cp == ' ' && cp >= b; --cp) + *cp = '\0'; + + if ( cp == b ){ + ++disable_log_messages; + tor_assert_nonfatal(*b); + --disable_log_messages; + } } switch (severity) { case LOG_DEBUG: s = "DEBUG"; break; |