Commit Graph

3 Commits

Author SHA1 Message Date
João Valverde 92e1357bb4 Rename ws_label_strcat() to ws_label_strcpy()
The semantics of ws_label_strcat() are closer to g_strlcpy() so
rename the function to reflect that.
2022-10-26 13:12:35 +01:00
João Valverde c149e4112f epan: Rename a test 2022-10-26 13:12:12 +01:00
João Valverde 603354203b epan/proto: Replace format text()
The proto.h APIs expect valid UTF-8 so replace uses of format_text()
with a label copy function that just does formatting and does not
check for encoding errors. Avoid multiple levels of temporary
string allocations.

Make sure the copy does not truncate a multibyte character and
produce invalid strings. Add debug checks for UTF-8 encoding errors
instead.

We escape C0 and C1 control codes (because control codes)
and ASCII whitespace (and bell).

Overall the goal is to be more efficient and optimized and help
detect misuse of APIs by passing invalid UTF-8.

Add a unit test for ws_label_strcat.
2022-10-20 20:05:15 +01:00