Skip to content

Commit

Permalink
Avoid urbk_safeClone; fixes #98 (#135)
Browse files Browse the repository at this point in the history
Use ubrk_clone instead.
  • Loading branch information
adamdickmeiss authored Jan 27, 2025
1 parent 5bfb937 commit d872be1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/icu_tokenizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,14 @@ static void icu_tokenizer_reset(struct icu_tokenizer *tokenizer,

struct icu_tokenizer *icu_tokenizer_clone(struct icu_tokenizer *old)
{
int32_t bufferSize = U_BRK_SAFECLONE_BUFFERSIZE;
UErrorCode status = U_ZERO_ERROR;
struct icu_tokenizer * tokenizer
= (struct icu_tokenizer *) xmalloc(sizeof(struct icu_tokenizer));

assert(old);
icu_tokenizer_reset(tokenizer, old->action);
assert(old->bi);
tokenizer->bi = ubrk_safeClone(old->bi, NULL, &bufferSize, &status);
tokenizer->bi = ubrk_clone(old->bi, &status);
if (U_SUCCESS(status))
return tokenizer;
return tokenizer;
Expand Down

0 comments on commit d872be1

Please sign in to comment.