Wireshark-dev: Re: [Wireshark-dev] format_text_wsp() not working?

From: João Valverde <j@xxxxxx>
Date: Tue, 15 Nov 2022 14:57:16 +0000
This is not going to work as intended:

    rawstr = tvb_format_text(pinfo->pool, tvb, offset, realsize - offset);
    col_add_fstr(pinfo->cinfo, COL_INFO, "Reply: %s", format_text_wsp(pinfo->pool, rawstr, realsize - offset));

The first call to tvb_format_text() already replaced "\n" with "\\n". The second call to format_text_wsp() never sees a newline and does nothing.

On 11/15/22 08:41, Anders Broman wrote:
Hi,
I encountered strange problem with

https://gitlab.com/wireshark/wireshark/-/merge_requests/8848
packet 2 of the included trace causes a call to
col_add_fstr(pinfo->cinfo, COL_INFO, "Reply: %s", format_text_wsp(pinfo->pool, rawstr, realsize - offset)); But it seems like the /n is not replaced with space using the debugger. It seems like the call to
format_text_internal() does not propagate "TRUE" ???
char *
format_text_wsp(wmem_allocator_t* allocator, const char *string, size_t len)
{
    return format_text_internal(allocator, string, len, TRUE);
}
Any ideas?

Best regards
Anders


___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
              mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe