@cryptotaxi247 / netdata-1 / commits / 9ccb3a452

Adjust text_sanitizer to accept the default value (#18870)

Allow src to receive the specified empty value

Stelios Fragkakis committed Oct 27, 2024 at 19:19 UTC 9ccb3a4520a22cfa635eed3057b440a9e76bfbdd
1 file changed +1 -1
src/libnetdata/sanitizers/utf8-sanitizer.c
+1 -1
@@ -3,7 +3,7 @@
3 #include "../libnetdata.h"
4
5 size_t text_sanitize(unsigned char *dst, const unsigned char *src, size_t dst_size, const unsigned char *char_map, bool utf, const char *empty, size_t *multibyte_length) {
6 - if(unlikely(!src || !dst || !dst_size)) return 0;
6 + if(unlikely(!dst || !dst_size)) return 0;
7
8 // skip leading spaces and invalid characters
9 while(src && *src && !IS_UTF8_BYTE(*src) && (isspace(*src) || iscntrl(*src) || !isprint(*src)))