[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Removes trailing spaces in control event log
commit ec7a6757ecdff7d6680fca42aba2802bc298e21a
Author: Amadeusz Pawlik <apawlik@xxxxxxxxxxxxxx>
Date: Sat Oct 26 20:06:48 2019 +0200
Removes trailing spaces in control event log
---
src/feature/control/control_events.c | 10 ++++++++++
1 file changed, 10 insertions(+)
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;
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits