Skip to content

Commit

Permalink
simdutf_connector: Handle newlines
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 committed Oct 10, 2024
1 parent 67cd41a commit f40ad15
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/simdutf/flb_simdutf_connector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ int flb_simdutf_connector_convert_from_unicode(int preferred_encoding,
if (len % 2) {
len--;
}
for (i = 0; i < len;) {
if (len < 2) {
return FLB_SIMDUTF_CONNECTOR_CONVERT_NOP;
}
for (i = 0 ; i < len;) {
if (i + 2 > len) {
break;
}
Expand All @@ -197,6 +200,9 @@ int flb_simdutf_connector_convert_from_unicode(int preferred_encoding,
if (len % 2) {
len--;
}
if (len < 2) {
return FLB_SIMDUTF_CONNECTOR_CONVERT_NOP;
}
for (i = 0; i < len;) {
if (i + 2 > len) {
break;
Expand Down

0 comments on commit f40ad15

Please sign in to comment.