-/* src/client/io.c */
+/* src/client/io.c
+ *
+ * This file is part of PlomRogue. PlomRogue is licensed under the GPL version 3
+ * or any later version. For details on its copyright, license, and warranties,
+ * see the file NOTICE in the root directory of the PlomRogue source package.
+ */
#define _POSIX_C_SOURCE 1 /* PIPE_BUF */
#include "io.h"
break;
}
int old_size = 0;
- if (NULL != world.player_inventory)
+ if (world.player_inventory)
{
old_size = strlen(world.player_inventory);
}
while (try_fgets(read_buf, linemax + 1, file, __func__))
{
int old_size = 0;
- if (NULL != world.log)
+ if (world.log)
{
old_size = strlen(world.log);
}
{
static uint8_t ping_sent = 0;
time_t now = time(0);
- if (ping_sent && last_server_answer_time > now - 3)
- {
- ping_sent = 0;
+ if (ping_sent && last_server_answer_time > now - 3) /* Re-set if last */
+ { /* ping was answered */
+ ping_sent = 0; /* with server */
+ return; /* activity. */
}
if (!ping_sent && last_server_answer_time < now - 3)
{