I've found the following code in a legacy project that seems to cause some trouble:
for( ; *str; ++str )
*str = tolower(*str);
The trouble is, we get an SIGSEGV at the moment the result of tolower() should be written back to *str . This is what I got from using printf() debugging and the stracktrace produces, as we're using JNI here and thus attaching a debugger to the C libraries is not working for us.
The code fails if it's compiled with gcc on linux. Running the same thing on windows (CMake is being used for this cross-plattform setup) works fine.
Where can I look to find the reason for this? Any hints appreciated :)
thank you - Markus