Also annotate `dbg_msg`, `str_format` and `str_timestamp_ex` so that the
compiler can determine whether the format strings are correct.
Fix the compiler warnings generated by these extra warnings -- some of
them were security issues.
This also fixes a couple of potential buffer overflows. The affected
code is still buggy (doesn't do the right thing on potential buffer
overflow), but at least it won't result in crashes/out of bound writes
anymore.
This means that we have a reliable and fast way to query for extended info,
while also not wasting network bandwidth.
The protocol is designed to be extensible, there's four bytes space for
encoding more request types (currently zeroed), and there's one string in each
response packet and one string for each player available (currently the empty
string).
The protocol itself has no problems with more than 64 players, although the
current client implementation will drop the player info after the 64th player,
because it uses a static array for storage.
Also fixes#130, the player list is just sorted each time new player info
arrives.
See UTS#39 "Unicode Security Mechanisms":
http://www.unicode.org/reports/tr39/
This means that characters with accents or other things around them are
now considered the confusable with the base character.
Fixes#557. Fixes#575.
This not only makes `str_utf8_decode` a compliant parser, but also fixes an
issue where overlong encodings led to undetected line breaks.
Implemented as per https://encoding.spec.whatwg.org/#utf-8-decoder.
Audited the following files, checking whether the new semantics work with the
existing code:
- src/base/system.c
- src/engine/client/text.cpp
- src/game/client/components/chat.cpp
- src/game/server/gamecontext.cpp
They all check whether the string is at its end separately.