Commit 666a10ac authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Flexelint



git-svn-id: http://www.varnish-cache.org/svn/trunk@2689 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 3fdc2a7e
...@@ -56,28 +56,29 @@ vct_dump(const char *ident, const char *pfx, const char *str) ...@@ -56,28 +56,29 @@ vct_dump(const char *ident, const char *pfx, const char *str)
vsb = vsb_new(NULL, NULL, 0, VSB_AUTOEXTEND); vsb = vsb_new(NULL, NULL, 0, VSB_AUTOEXTEND);
if (str == NULL) if (str == NULL)
vsb_printf(vsb, "#### %-4s %s(null)\n", ident, pfx); vsb_printf(vsb, "#### %-4s %s(null)\n", ident, pfx);
for(; *str; str++) { else
if (nl) { for(; *str; str++) {
vsb_printf(vsb, "#### %-4s %s| ", ident, pfx); if (nl) {
nl = 0; vsb_printf(vsb, "#### %-4s %s| ", ident, pfx);
nl = 0;
}
if (*str == '\r')
vsb_printf(vsb, "\\r");
else if (*str == '\t')
vsb_printf(vsb, "\\t");
else if (*str == '\n') {
vsb_printf(vsb, "\\n\n");
nl = 1;
} else if (*str < 0x20 || *str > 0x7e)
vsb_printf(vsb, "\\x%02x", *str);
else
vsb_printf(vsb, "%c", *str);
} }
if (*str == '\r')
vsb_printf(vsb, "\\r");
else if (*str == '\t')
vsb_printf(vsb, "\\t");
else if (*str == '\n') {
vsb_printf(vsb, "\\n\n");
nl = 1;
} else if (*str < 0x20 || *str > 0x7e)
vsb_printf(vsb, "\\x%02x", *str);
else
vsb_printf(vsb, "%c", *str);
}
if (!nl) if (!nl)
vsb_printf(vsb, "\n"); vsb_printf(vsb, "\n");
vsb_finish(vsb); vsb_finish(vsb);
AZ(vsb_overflowed(vsb)); AZ(vsb_overflowed(vsb));
fputs(vsb_data(vsb), stdout); (void)fputs(vsb_data(vsb), stdout);
vsb_delete(vsb); vsb_delete(vsb);
} }
......
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