X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=src%2Fserver%2Fio.c;h=eb54799c5dc052d6245717ddb21f44afec2118fe;hb=6cae62aad97d9220253cba2a9c0881f714a63d1c;hp=8f8f738b46533dcbf099e08948f7524dc650e163;hpb=3dedf6344c941891491773d1cc5d647aa664b218;p=plomrogue diff --git a/src/server/io.c b/src/server/io.c index 8f8f738..eb54799 100644 --- a/src/server/io.c +++ b/src/server/io.c @@ -1,4 +1,9 @@ -/* src/server/io.c */ +/* src/server/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 200112L /* snrpintf() */ #include "io.h" @@ -289,7 +294,7 @@ static void write_value_as_line(uint32_t value, FILE * file) static void write_inventory(struct Thing * player, FILE * file) { struct Thing * owned = player->owns; - if (NULL == owned) + if (!owned) { char * empty = "(none)\n"; try_fwrite(empty, strlen(empty), 1, file, __func__); @@ -297,7 +302,7 @@ static void write_inventory(struct Thing * player, FILE * file) else { uint8_t q; - for (q = 0; NULL != owned; q++) + for (q = 0; owned; q++) { struct ThingType * tt = get_thing_type(owned->type); try_fwrite(tt->name, strlen(tt->name), 1, file, __func__); @@ -372,7 +377,7 @@ static void write_map(struct Thing * player, FILE * file) struct ThingInMemory * tm; for (i = 0; i < 2; i++) { - for (tm = player->t_mem; tm != NULL; tm = tm->next) + for (tm = player->t_mem; tm; tm = tm->next) { if (' ' != player->mem_map[tm->pos.y*world.map.length+tm->pos.x]) {