]> tinc-vpn.org Git - tinc/blobdiff - src/protocol.c
Removed two newlines from the end of log messages which created empty lines.
[tinc] / src / protocol.c
index 90eca015ea5d5a009749afa27fa1e0e69161a71c..6cb29bf73d250f4524ffd5778629d47a1fb9d6f1 100644 (file)
@@ -103,6 +103,7 @@ bool send_request(connection_t *c, const char *format, ...) {
 }
 
 void forward_request(connection_t *from, char *request) {
+       /* Note: request is not zero terminated anymore after a call to this function! */
        ifdebug(PROTOCOL) {
                ifdebug(META)
                        logger(LOG_DEBUG, "Forwarding %s from %s (%s): %s",
@@ -113,7 +114,7 @@ void forward_request(connection_t *from, char *request) {
        }
 
        int len = strlen(request);
-       request[len] = '\n';
+       request[len++] = '\n';
        broadcast_meta(from, request, len);
 }
 
@@ -227,5 +228,6 @@ void init_requests(void) {
 void exit_requests(void) {
        splay_delete_tree(past_request_tree);
 
-       event_del(&past_request_event);
+       if(timeout_initialized(&past_request_event))
+               event_del(&past_request_event);
 }