baylej / tmx

C tmx map loader
http://libtmx.rtfd.io/
BSD 2-Clause "Simplified" License
242 stars 54 forks source link

Change strtol to strtoul #52

Closed Elatronion closed 4 years ago

Elatronion commented 4 years ago

The function strtol() is not able to convert numbers that are larger than LONG_MAX and smaller than LONG_MIN as it uses signed numbers. This can cause issues on different platforms; strtoul() should be used for unsigned long integers. Discovered when trying to compile code with i686-w64-mingw32-gcc for Windows.

baylej commented 4 years ago

Hi, Thanks for your contribution, indeed a long is 4 bytes on windows, 8 on all other platforms, meh :unamused: