Commit 78db2e87 authored by Pekka Pessi's avatar Pekka Pessi

tport_logging.c: fixed problem logging long lines

Problem reported by Mike Murdock and Michael Jerris.

darcs-hash:20070328135847-55b16-c50235ff3460c6cc36e0b6aa9730bf2074e3fd08.gz
parent f20ad26d
......@@ -221,17 +221,17 @@ void tport_log_msg(tport_t *self, msg_t *msg,
n = strncspn(s, end - s, "\r\n");
if (linelen + n > MAX_LINELEN) {
n = MAX_LINELEN - n - linelen;
n = MAX_LINELEN - linelen;
truncated = logged + n;
}
su_log("%s%.*s", linelen > n ? "" : " ", (int)n, s);
su_log("%s%.*s", linelen > 0 ? "" : " ", (int)n, s);
s += n, linelen += n, logged += n;
if (truncated)
break;
if (s == end)
continue;
break;
linelen = 0;
su_log("\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment