/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2007, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
{
if (tlev < buil_bt)
return;
- pr("Bridges require %g tech,", buil_bt);
- pr(" %d hcm,", buil_bh);
- pr(" %d workers,\n", 0);
+ pr("Bridges require %g tech, %d hcm, 0 workers,\n",
+ buil_bt, buil_bh);
pr("%d available workforce, and cost $%g\n",
(SCT_BLD_WORK(0, buil_bh) * SCT_MINEFF + 99) / 100,
buil_bc);
{
if (tlev < buil_tower_bt)
return;
- pr("Bridge Towers require %g tech,", buil_tower_bt);
- pr(" %d hcm,", buil_tower_bh);
- pr(" %d workers,\n", 0);
+ pr("Bridge Towers require %g tech, %d hcm, 0 workers,\n",
+ buil_tower_bt, buil_tower_bh);
pr("%d available workforce, and cost $%g\n",
(SCT_BLD_WORK(0, buil_tower_bh) * SCT_MINEFF + 99) / 100,
buil_tower_bc);
int scount;
int techdiff;
- pr("%25s s v s r f l p", "");
- pr(" h");
- pr(" x");
+ pr("%25s s v s r f l p h x", "");
if (opt_FUEL)
pr(" fuel");
pr("\n");
- pr("%25s p i p n i n l", "");
- pr(" e");
- pr(" p");
+ pr("%25s p i p n i n l e p", "");
if (opt_FUEL)
pr(" c/u");
pr("\n");
- pr("%25s def d s y g r d n", "");
- pr(" l");
- pr(" l");
+ pr("%25s def d s y g r d n l l", "");
if (opt_FUEL)
pr(" ");
pr("\n");
int nn;
TIME_ZONE_INFORMATION tzi;
long time_offset;
- struct tm time;
+ struct tm *time;
- localtime_s(&time, &t);
+ time = localtime(&t);
- n = strftime(buf, sizeof(buf), "%a, %d %b %Y %H:%M:%S", &time);
+ n = strftime(buf, sizeof(buf), "%a, %d %b %Y %H:%M:%S", time);
if (CANT_HAPPEN(n == 0)) {
buf[0] = 0;
return buf;
}
GetTimeZoneInformation(&tzi);
time_offset = -(tzi.Bias +
- (time.tm_isdst ? tzi.DaylightBias : tzi.StandardBias));
+ (time->tm_isdst ? tzi.DaylightBias : tzi.StandardBias));
- nn = _snprintf_s(buf + n, sizeof(buf) - n, sizeof(buf) - n -1,
- " %+03d%02d", time_offset/60, abs(time_offset) % 60);
- if (CANT_HAPPEN(nn <= 0))
+ nn = _snprintf(buf + n, sizeof(buf) - n, " %+03d%02d",
+ time_offset/60, abs(time_offset) % 60);
+ if (CANT_HAPPEN(nn <= 0 || nn + n >= sizeof(buf)))
buf[0] = 0;
#else
- size_t int n = strftime(buf, sizeof(buf), "%a, %d %b %Y %T %z",
+ size_t n = strftime(buf, sizeof(buf), "%a, %d %b %Y %T %z",
localtime(&t));
if (CANT_HAPPEN(n == 0))
buf[0] = 0;