playerName can be NULL. Check if it is before logging
authorfatbob313 <martin@fatbob.nu>
Sat, 30 Jan 2010 21:10:34 +0000 (21:10 +0000)
committerfatbob313 <martin@fatbob.nu>
Sat, 30 Jan 2010 21:10:34 +0000 (21:10 +0000)
src/log.c

index 273964120b121d37c160408050fc0c06da57b3af..8990c03cd448adab31cc5c7edfba21d1564dc81d 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -115,7 +115,7 @@ void Log_info_client(client_t *client, const char *logstring, ...)
        va_end(argp);
        offset += snprintf(&buf[offset], STRSIZE - offset, " - [%d] %s@%s:%d",
                                           client->sessionId,
-                                          client->playerName,
+                                          client->playerName == NULL ? "" : client->playerName,
                                           inet_ntoa(client->remote_tcp.sin_addr),
                                           ntohs(client->remote_tcp.sin_port));
        strcat(buf, "\n");