> POSIX char is 1 byte. So "sizeof(char)" is always 1. I noticed that when you said that.
> Funny things also happen when you have a Compose sequence longer than > 255 bytes, but it seems that something more is going on there. Are you saying that even if the buffer size is sufficient, if the data received is longer than 255 bytes, a problem will occur? I have tried it, but nothing happens in my environment. The only reason I left the buffer is that I didn't want to have a memory leak if I made a mistake somewhere and used return. If such considerations are not necessary, I agree with Storkman's suggestion.