X-Git-Url: http://git.pond.sub.org/?p=empserver;a=blobdiff_plain;f=src%2Flib%2Fcommands%2Finfo.c;h=961ad606b4c93c330d5783f15bd1effd644ca36e;hp=128b9fda6bf65b8f8f0549dbe0ae71a9d8c04031;hb=7b9e579408306be4f37ac26fd6c349841dcf11dd;hpb=d111522fe821f0e606161ed75e0e18523f793469 diff --git a/src/lib/commands/info.c b/src/lib/commands/info.c index 128b9fda6..961ad606b 100644 --- a/src/lib/commands/info.c +++ b/src/lib/commands/info.c @@ -1,6 +1,6 @@ /* * Empire - A multi-player, client/server Internet based war game. - * Copyright (C) 1986-2018, Dave Pare, Jeff Bailey, Thomas Ruschak, + * Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak, * Ken Stevens, Steve McClure, Markus Armbruster * * Empire is free software: you can redistribute it and/or modify @@ -41,6 +41,7 @@ #include #include #if !defined(_WIN32) +#include #include #endif #include "commands.h" @@ -144,7 +145,7 @@ info(void) fclose(fp); return RET_FAIL; } - if ((statb.st_mode & S_IFREG) == 0) { + if (!S_ISREG(statb.st_mode)) { pr("Error reading info file for %s\n", name); logerror("The info file \"%s\" is not regular file\n", filename); fclose(fp); @@ -219,7 +220,7 @@ apro(void) fclose(fp); continue; } - if ((statb.st_mode & S_IFREG) == 0) { + if (!S_ISREG(statb.st_mode)) { logerror("The info file \"%s\" is not regular file\n", filename); fclose(fp);