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:
Markus Armbruster 2004-03-09 12:27:40 +00:00
parent 735adbf41b
commit e7d75b2279
38 changed files with 106 additions and 93 deletions

View file

@ -72,7 +72,7 @@ disloan(int n, register struct lonstr *loan)
pr("\nLoan #%d from %s to", n, cname(loan->l_loner));
pr(" %s\n", cname(loan->l_lonee));
if (loan->l_status == LS_PROPOSED) {
pr("(proposed) principal=$%d interest rate=%d%%",
pr("(proposed) principal=$%ld interest rate=%d%%",
loan->l_amtdue, loan->l_irate);
pr(" duration(days)=%d\n", loan->l_ldur);
if (loan->l_duedate < now) {
@ -103,7 +103,7 @@ disloan(int n, register struct lonstr *loan)
owe = ((double)loan->l_amtdue *
(((double)normaltime * rate + 1.0) +
((double)doubletime * rate * 2.0))) + 0.5;
pr("Amount paid to date $%d\n", loan->l_amtpaid);
pr("Amount paid to date $%ld\n", loan->l_amtpaid);
pr("Amount due (if paid now) $%.2f", owe);
if (doubletime == 0) {
pr(" (if paid on due date) $%.2f\n",