On 5/21/24 2:42 PM, Grisha Levit wrote:
Avoid using (size_t)-1 as an offset.
I can't reproduce this on macOS. Where is the code that's using -1 as an offset?
Also, not sure it makes sense to change the case of an invalid byte cast to (wchar_t).
Bash and readline are pretty consistent about treating invalid multibyte characters as a sequence of bytes. Maybe the thing to do here is to add a goto to the single-byte case if m == (size_t)-1 or (size_t)-2, but assigning a byte to a wchar_t variable isn't harmful, since wchar_t is guaranteed to be an integral type. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature