Fix various undefined behaviors - Initialize local variables before their first use - `time_t` has an implementation-defined type. It must be converted to a specific type before being passed to `sprintf`. - Fix OOB access to `packets` - Truncate long chat messages. Note that the server can send a chat message with an arbitrary length. (commit: 0736596)