"Alvaro Lopez Ortega" <[EMAIL PROTECTED]> wrote:
> Ross Smith II wrote, On 27/06/07 14:09:
>
> > Changeset 775 did not include the following patch:
> >
> > +#ifdef strerror
> > +#undef strerror
> > +#endif
> > +
> > char *win_strerror (int err)
>
> Yeah, I don't think that's the right thing to do. Check this out:
>
> ==========
> char *win_strerror (int err)
> {
> [..]
> if (err >= 0 && err < sys_nerr) {
> strncpy (buf, strerror(err), sizeof(buf)-1);
> ==========
>
> The function is called just a few lines after you #undef.
>
> Why would you want to do that, anyway? strerror() is defined in
> string.h. :-?
Since I wrote that, I should comment. Ross is right, there should be
an "#undef strerror" before using strerror() in win32_misc.c (otherwise
an infinite recursion would be the result).
Or better yet do:
if (err >= 0 && err < sys_nerr) {
strncpy (buf, (strerror)(err), sizeof(buf)-1);
--gv
_______________________________________________
Cherokee mailing list
[email protected]
http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee