/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2005, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
*
* ---
*
- * See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- * related information and legal notices. It is expected that any future
- * projects/authors will amend these files as needed.
+ * See files README, COPYING and CREDITS in the root of the source
+ * tree for related information and legal notices. It is expected
+ * that future projects/authors will amend these files as needed.
*
* ---
*
* Steve McClure, 1998-2000
*/
-#include "misc.h"
-#include "player.h"
+#include <config.h>
+
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <sys/stat.h>
+#include <time.h>
#if !defined(_WIN32)
#include <dirent.h>
#else
#include <windows.h>
#endif
+#include "misc.h"
+#include "player.h"
#include "commands.h"
#include "optlist.h"
snprintf(filename, sizeof(filename), "%s/%s", infodir, name);
fp = fopen(filename, "r");
if (fp == NULL) {
- int len = strlen(name);
/* may be a "partial" request. */
info_dp = opendir(infodir);
if (info_dp == 0) {
/* may be a "partial" request. */
HANDLE hDir;
WIN32_FIND_DATA fData;
- int len = strlen(name);
strcat(filename, "*");
hDir = FindFirstFile(filename, &fData);
if (hDir == INVALID_HANDLE_VALUE) {
break;
default:
pr("Error reading info dir\n");
- logerror("Error (%d) reading info dir(%s)\\file(%s)",
- infodir, filename, GetLastError());
+ logerror("Error (%lu) reading info dir(%s)\\file(%s)",
+ GetLastError(), infodir, filename);
}
return RET_SYS;
}
else {
DWORD fAttrib = GetFileAttributes(filename);
if ((fAttrib == (DWORD)-1) || /* INVALID_FILE_ATTRIBUTES */
- (fAttrib != FILE_ATTRIBUTE_NORMAL) &&
- (fAttrib != FILE_ATTRIBUTE_ARCHIVE) &&
- (fAttrib != FILE_ATTRIBUTE_READONLY)) {
+ ((fAttrib != FILE_ATTRIBUTE_NORMAL) &&
+ (fAttrib != FILE_ATTRIBUTE_ARCHIVE) &&
+ (fAttrib != FILE_ATTRIBUTE_READONLY))) {
pr("Error reading info file for %s\n", name);
logerror("The info file \"%s\" is not regular file\n",
filename);
logerror("Can't open info dir \"%s\"", infodir);
} else {
pr("Error reading info dir\n");
- logerror("Error (%d) reading info dir(%s)\\file(%s)",
- infodir, filename, GetLastError());
+ logerror("Error (%lu) reading info dir(%s)\\file(%s)",
+ GetLastError(), infodir, filename);
}
return RET_SYS;
}
free(lbp);
if ((nhl) > lhitlim) {
- pr("Limit of %ld lines exceeded\n", lhitlim);
+ pr("Limit of %d lines exceeded\n", lhitlim);
}
pr("Found %s in %ld of %ld files and in %ld of %ld lines\n",
name, nhf, nf, nhl, nl);