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

2022-11-15 Thread Anders Broman
Hi,
Good catch, thanks.
Best regards
Anders

Den tis 15 nov. 2022 kl 15:57 skrev João Valverde :

> 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 
> > Archives:https://www.wireshark.org/lists/wireshark-dev
> > Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
> >   mailto:wireshark-dev-requ...@wireshark.org
> ?subject=unsubscribe
>
> ___
> Sent via:Wireshark-dev mailing list 
> Archives:https://www.wireshark.org/lists/wireshark-dev
> Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
>  mailto:wireshark-dev-requ...@wireshark.org
> ?subject=unsubscribe
>
___
Sent via:Wireshark-dev mailing list 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
 mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe


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

2022-11-15 Thread João Valverde

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 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
  mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe


___
Sent via:Wireshark-dev mailing list 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe


[Wireshark-dev] format_text_wsp() not working?

2022-11-15 Thread Anders Broman
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 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
 mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe