RE: [AD] 3 patches regarding unicode and buffer overfows (mostly)

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


> > Maybe return -1 (overflow), 0 (cancel), 1 (ok)?  But people might be
> > checking file_select() == TRUE (which == -1), and I definitely don't
> > want `file_select' and `file_select_ex' to return different values.
> > -1 (ok), 0 (cancel), 1 (overflow) is also possible, but feels
> > strange to me.
> 
> Maybe can we make use of the libc errno variable ?
> The file selector could return ENAMETOOLONG when the path buffer 
> overflowed.

errno is to be checked only whenever a routine returns an error, and it is
not to be expected to be zero'd when a routine terminates sucessfully.
Besides that, I agree it's a sensible suggestion.

-- 
Lyrian 



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