Re: [AD] Unicode again

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> No, I meant that the routine, if outputting a terminating NULL, should
> ensure that it does so in the bounds of the given size (effectively making
> sure it substracts itself the needed space for the NULL from the given
> size argument).

But the ANSI strncat() doesn't do it. Should Allegro do it then ?

> Inconsistency between Allegro routines ? If these are the same as the
> inconsistencies between libc functions, then I think this is OK.

I disagree here. Unless someone can give me a good reason for the behaviour
of strncpy() compared with that of strncat(), I'll keep viewing it as an
inconsistency.

> If you prefer another (more self consistent) behavior, it is still
> possible to add either other functions or macros which alter the
> size parameter, as:
>
> #define ustrnconcat(s,size) ustrncat((s),(size)-ucwidth(0))

I'm ok with ustrncat(): it follows ANSI standard's behaviour.
ustrncpy() is the problem.

--
Eric Botcazou
ebotcazou@xxxxxxxxxx



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/