summaryrefslogtreecommitdiff
path: root/src/feature
diff options
context:
space:
mode:
authorAmadeusz Pawlik <apawlik@protonmail.com>2019-10-26 20:06:48 +0200
committerNick Mathewson <nickm@torproject.org>2020-10-28 09:08:53 -0400
commitec7a6757ecdff7d6680fca42aba2802bc298e21a (patch)
tree58e5e15bed40b0843facdb93e21baa2052f7d156 /src/feature
parent2edda444da8d66cbbe86af3c97352ab9b89d651d (diff)
downloadtor-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.c10
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;