28 Aug
2007
28 Aug
'07
5:20 a.m.
Hi, Alan DeKok wrote:
Enrik Berkhan wrote:
- I'd add a length parameter and check for str to utf8_char().
Not needed. The C string termination character '\0' is not a valid UTF-8 character.
You're right, if it's guaranteed to be called with a terminated string. You might add a comment, though :)
I think with a little fixing this can make it into HEAD and 1.1.x to be tested by others.
Please try the following patch. It's a little clearer.
It works ok with the same little test and actually it is a lot cleaner now. The 'done' counter in librad_safeprint() is not needed AFAICS as 'outlen' is decremented each time 'done' is incremented. Thus, the condition at the top while loop is wrong. Enrik