Beariish/little

Several issues

Opened this issue · 0 comments

rilysh commented

Hello. When compiling little on Linux I noticed several issues here.

  1. Compatibility issues with sprintf_s(...). This function only exists in Windows and the equivalent (for Unix-based systems) is snprintf(...). Windows do have snprintf(...) (see this) so using that function reasonably increase compatibility between two systems. Another function, called strncpy_s(...) is again, Windows specific. However, strncpy(...) can do exactly the same job except it will not have numberOfElements param (which seems to me unreasonable and confusing to use).

  2. There are several areas in code, I saw casting is unreasonable and does a totally different job. Most of them are incompatible pointer casts and at line 349; it's representing pointer insider pointer and comparing or doing arithmetic work will yield invalid operands error. I'm not sure which compiler you've used that ignores this thing.