Commit 862c6a17 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Don't output trailing '\0' of SLT_Debug records

SLT_Debug is special as it is both used as a binary log record and as
a text record. Add a special case for it and don't escape-output the
trailing zero.
parent b5929ad7
......@@ -255,6 +255,8 @@ VSL_Print(const struct VSL_data *vsl, const struct VSL_cursor *c, void *fo)
if (VSL_tagflags[tag] & SLT_F_BINARY) {
VSL_PRINT(fo, "%10u %-14s %c \"", vxid, VSL_tags[tag], type);
while (len-- > 0) {
if (len == 0 && tag == SLT_Debug && *data == '\0')
break;
if (*data >= ' ' && *data <= '~')
VSL_PRINT(fo, "%c", *data);
else
......@@ -288,6 +290,8 @@ VSL_PrintTerse(const struct VSL_data *vsl, const struct VSL_cursor *c, void *fo)
if (VSL_tagflags[tag] & SLT_F_BINARY) {
VSL_PRINT(fo, "%-14s \"", VSL_tags[tag]);
while (len-- > 0) {
if (len == 0 && tag == SLT_Debug && *data == '\0')
break;
if (*data >= ' ' && *data <= '~')
VSL_PRINT(fo, "%c", *data);
else
......
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