Skip to content

Commit

Permalink
Adjust text_sanitizer to accept the default value (netdata#18870)
Browse files Browse the repository at this point in the history
Allow src to receive the specified empty value
  • Loading branch information
stelfrag authored Oct 27, 2024
1 parent c7b9f52 commit 9ccb3a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libnetdata/sanitizers/utf8-sanitizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "../libnetdata.h"

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) {
if(unlikely(!src || !dst || !dst_size)) return 0;
if(unlikely(!dst || !dst_size)) return 0;

// skip leading spaces and invalid characters
while(src && *src && !IS_UTF8_BYTE(*src) && (isspace(*src) || iscntrl(*src) || !isprint(*src)))
Expand Down

0 comments on commit 9ccb3a4

Please sign in to comment.