Use gcc function attribute `format' to catch bad format strings. Fix
them. From Marc Olzheim. Type modifier 'l' was missing in many places, probably rendering the server useless on 64-bit hosts. (ef_flush, ef_write, ef_extend, lwpCreate, lwpDestroy): Use conversion specifier 'p' to print pointers. (check_market): Fix display of loan amount. (doland): Fix unescaped '%' (undefined behavior). (ldump, ndump, pdump, sdump): Don't use flag '0' with conversion specifier 's' (undefined behavior). (dump, ldump, lost, ndump, pdump, sdump, empth_create, update_sched): Cast time_t and pthread_t to long for printing. (lwpStackCheck, lwpStackCheckUsed, finish_sects): Insert cast to fix argument type on all platforms. (prod): Remove extra argument. (perform_mission, airdamage, retreat_land1, lwpReschedule): Format string missed arguments.
This commit is contained in:
parent
735adbf41b
commit
e7d75b2279
38 changed files with 106 additions and 93 deletions
|
@ -179,7 +179,7 @@ prod_nat(int etu)
|
|||
levels[n][NAT_RLEV] =
|
||||
limit_level(levels[n][NAT_RLEV] / 1, NAT_RLEV, 0) * 1;
|
||||
wu((natid)0, n,
|
||||
"total pop is %d, yielding %4.2f hap, %4.2f edu\n",
|
||||
"total pop is %ld, yielding %4.2f hap, %4.2f edu\n",
|
||||
pop - 1, hap, edu);
|
||||
}
|
||||
if (ally_factor > 0.0)
|
||||
|
@ -212,9 +212,9 @@ prod_nat(int etu)
|
|||
if ((sea_money[n] != 0) || (air_money[n] != 0) ||
|
||||
(lnd_money[n] != 0))
|
||||
wu((natid)0, n,
|
||||
"Army delta $%d, Navy delta $%d, Air force delta $%d\n",
|
||||
"Army delta $%ld, Navy delta $%ld, Air force delta $%ld\n",
|
||||
lnd_money[n], sea_money[n], air_money[n]);
|
||||
wu((natid)0, n, "money delta was $%d for this update\n",
|
||||
wu((natid)0, n, "money delta was $%ld for this update\n",
|
||||
np->nat_money - money[n]);
|
||||
if (opt_LOSE_CONTACT) {
|
||||
for (cn = 0; cn <= MAXNOC; cn++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue