Skip to content

Commit

Permalink
u8norm tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
rurban committed Dec 22, 2023
1 parent 38e7958 commit d85e519
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/extu8/u8norm_s.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,11 +769,13 @@ EXPORT errno_t _u8norm_reorder_s_chk(char8_t *restrict dest, rsize_t dmax,
}
if (seq_ext)
free(seq_ext);
/* surrogate pairs can actually collapse */
#if 0
/* surrogate pairs can actually collapse */
#if defined(SAFECLIB_STR_NULL_SLACK)
memset(dest, 0, dmax);
#else
*dest = 0;
#endif
#endif
return EOK;
}
Expand Down Expand Up @@ -1031,8 +1033,7 @@ EXPORT errno_t _u8norm_s_chk(char8_t *restrict dest, rsize_t dmax,
char8_t *tmp_ptr;
char8_t *tmp = NULL;
rsize_t len;
const bool iscompat =
mode & WCSNORM_NFKD; /* WCSNORM_NFKD or WCSNORM_NFKC */
const bool iscompat = (mode & WCSNORM_NFKD) || (mode & WCSNORM_NFKC);

errno_t rc =
_u8norm_decompose_s_chk(dest, dmax, src, &len, iscompat, destbos);
Expand Down
2 changes: 1 addition & 1 deletion src/extwchar/wcsnorm_s.c
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ EXPORT errno_t _wcsnorm_reorder_s_chk(wchar_t *restrict dest, rsize_t dmax,
}
if (seq_ext)
free(seq_ext);
/* surrogate pairs can actually collapse */
/* surrogate pairs can actually collapse */
#if defined(SAFECLIB_STR_NULL_SLACK) && SIZEOF_WCHAR_T == 2
memset(dest, 0, dmax * sizeof(wchar_t));
#else
Expand Down

0 comments on commit d85e519

Please sign in to comment.