Skip to content

Fix memory pre-allocation for multibyte separators#8

Open
szabgab wants to merge 1 commit intotov:masterfrom
szabgab:pre-allocation
Open

Fix memory pre-allocation for multibyte separators#8
szabgab wants to merge 1 commit intotov:masterfrom
szabgab:pre-allocation

Conversation

@szabgab
Copy link
Copy Markdown

@szabgab szabgab commented Feb 28, 2026

The statement changed tried to allocate enough space for the original string + 1 byte for each separator. This is not enough when the separator itself is multibyte (e.g. an emoji)

The smilies test-case uses 2 emojies as separators.

See #7

The statement changed tried to allocate enough space for the
original string + 1 byte for each separator. This is not enough
when the separator itself is multibyte (e.g. an emoji)

The smilies test-case uses 2 emojies as separators.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant