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
|
@ -140,8 +140,8 @@ ef_flush(int type)
|
|||
return 0;
|
||||
}
|
||||
if (write(ep->fd, ep->cache, size) != size) {
|
||||
logerror("ef_flush: %s cache write(%d, %x, %d) -> %d",
|
||||
ep->name, ep->fd, ep->cache, ep->size, r);
|
||||
logerror("ef_flush: %s cache write(%d, %p, %d) -> %d",
|
||||
ep->name, ep->fd, (void *)ep->cache, ep->size, r);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -278,8 +278,8 @@ ef_write(int type, int id, caddr_t ptr)
|
|||
if (ep->prewrite)
|
||||
ep->prewrite(id, ptr);
|
||||
if ((r = write(ep->fd, ptr, ep->size)) != ep->size) {
|
||||
logerror("ef_write: %s #%d write(%d, %x, %d) -> %d",
|
||||
ep->name, id, ep->fd, ptr, ep->size, r);
|
||||
logerror("ef_write: %s #%d write(%d, %p, %d) -> %d",
|
||||
ep->name, id, ep->fd, (void *)ptr, ep->size, r);
|
||||
return 0;
|
||||
}
|
||||
if (id >= ep->baseid && id < ep->baseid + ep->cids) {
|
||||
|
@ -368,8 +368,8 @@ ef_extend(int type, int count)
|
|||
if (ep->init)
|
||||
ep->init(cur, ptr);
|
||||
if ((r = write(ep->fd, ptr, ep->size)) != ep->size) {
|
||||
logerror("ef_extend: %s +#%d write(%d, %x, %d) -> %d",
|
||||
ep->name, count, ep->fd, ptr, ep->size, r);
|
||||
logerror("ef_extend: %s +#%d write(%d, %p, %d) -> %d",
|
||||
ep->name, count, ep->fd, (void *)ptr, ep->size, r);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue