facebookarchive / RakNet

RakNet is a cross platform, open source, C++ networking engine for game programmers.
Other
3.3k stars 1.02k forks source link

Update RakString.cpp #90

Closed DareM-A0 closed 8 years ago

DareM-A0 commented 8 years ago

Issue #79 RakString doesn't handle long string correctly on Linux. _vsnprintf truncates on Linux, on Windows it returns -1.

DareM-A0 commented 8 years ago

Linux handles string differently: _vsnprintf is a macro for vsnprintf and too long string are truncated and return value isn't -1 like it is on Windows _vsnprintf.

Luke1410 commented 6 years ago

Reviewed the patch. Looks good. However, we are not applying this in our fork SLikeNet since we moved over to use vsnprintf_s() there and hence solved the issue as part of this change (already incorporated in SLikeNet 0.1.0).