You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you're defining utf8proc_ssize_t as several different types according to platform, could you also have something like UTF8PROC_SSIZE_MIN, UTF8PROC_SSIZE_MAX, so it would be easier to have some safe conversion from size_t to it? This is mostly because of utf8proc_iterate using utf8proc_ssize_t strlen.
Regards,
Matt
The text was updated successfully, but these errors were encountered:
Sure, we could define UTF8PROC_SSIZE_MAX ; a PR would be welcome.
utf8proc_ssize_t is a signed type that should be the same size as size_t on all known platforms.
So, the only time it would be not safe to convert would be if the length is ≥ 2^(n-1) on an n-bit platform. On a 64-bit platform this will never happen for any real string buffer.
Hi,
If you're defining utf8proc_ssize_t as several different types according to platform, could you also have something like UTF8PROC_SSIZE_MIN, UTF8PROC_SSIZE_MAX, so it would be easier to have some safe conversion from size_t to it? This is mostly because of utf8proc_iterate using utf8proc_ssize_t strlen.
Regards,
Matt
The text was updated successfully, but these errors were encountered: