Menu

#5 Error with cygwin and gcc 3.4.1

open
nobody
None
5
2005-03-08
2005-03-08
Anonymous
No

On my system softwire crashed due to String.hpp:
#ifdef __GNUG__
inline int stricmp(const char *string1, const char
*string2)
{
return strcasecmp(string1, string2);
}
#endif

This will segfault on cygwin, I fixed using the following:

#ifdef __GNUG__
inline int stricmp(const char *string1, const char
*string2)
{
while(*string1 && *string2) {
if(tolower(*string1) != tolower(*string2))
return tolower(*string1) < tolower(*string2) ? -1 : 1;
++string1;
++string2;
}
return 0;
}
#endif

Discussion

  • Nicolas Capens

    Nicolas Capens - 2005-03-09

    Logged In: YES
    user_id=628186

    Thanks for the fix! I'll include it in the next release.

     
  • Rodrigo Kumpera

    Rodrigo Kumpera - 2005-03-10

    Logged In: YES
    user_id=952

    Just a side not, the code snippet should not be used as a
    fix, it's just the hack I used to make softwire work.

    I think a check for cygwin should be made to be sure the
    function is realy needed.

    Anyway, thanks for the great lib!

     

Log in to post a comment.