The th_brk() and th_brk_find_breaks() functions take the input string size as size_t, but return the results in an int array, effectively limiting possible results to the first INT_MAX characters. Users of this function must therefore ensure that either the input never exceeds 2Gi characters, or find a way to loop over the function in chunks of no more than INT_MAX characters, which is far from obvious whether it's possible or how it should be done (at least to this developer, who doesn't have a clue about libthai but needs to fix 64-bit issues).
Suggestion: widen the result array to size_t, document how to loop for existing versions.
The
th_brk()
andth_brk_find_breaks()
functions take the input string size assize_t
, but return the results in anint
array, effectively limiting possible results to the first INT_MAX characters. Users of this function must therefore ensure that either the input never exceeds 2Gi characters, or find a way to loop over the function in chunks of no more than INT_MAX characters, which is far from obvious whether it's possible or how it should be done (at least to this developer, who doesn't have a clue about libthai but needs to fix 64-bit issues).Suggestion: widen the result array to size_t, document how to loop for existing versions.