]> git.pond.sub.org Git - empserver/commit
Don't write garbage to unused trade destination in trade file
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 27 Jun 2010 09:35:08 +0000 (11:35 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 25 Jul 2010 15:48:53 +0000 (17:48 +0200)
commit10736cd1574ee6b39a5cdb9c3618c2f932174839
tree064ed9b20f33b8a467e3a3fefd3271917dba4762
parent8c78b1188b9159b866288a2e0eec661306b6f467
Don't write garbage to unused trade destination in trade file

struct trdstr members trd_x, trd_y are used only for teleporting
trades.  For others, trad() wrote garbage coordinates to the trade
file.  They weren't used except by xdump.  Fortunately, even there
they're visible only to deities.

Write invalid coordinates instead.  Do that in set() as well, so that
coordinates are valid only when we have a teleport destination.

Spotted by the Clang Static Analyzer.
include/trade.h
src/lib/commands/set.c
src/lib/commands/trad.c