]> git.pond.sub.org Git - empserver/commit
Clean up how game state file sizes are checked
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 1 May 2011 12:18:24 +0000 (14:18 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 25 Jun 2011 14:50:06 +0000 (16:50 +0200)
commit0fcd935999655b6be2af1d8db24e2b95da49d57f
tree3d134781ce3bdf3bee746e91fba9b1ee9670c0ab
parent516ab86a6e1f394ccad9481ef834c1578680822a
Clean up how game state file sizes are checked

New struct empfile member nent replaces ef_open() parameter nelt.
Cleaner, because the expected size is a property of the file, not of
how it's used.  Also fixes empdump to check file sizes.

Complication: with EFF_CREATE, ef_open() creates an empty file, to be
extended to the correct size.  Callers passed nelt argument -1 along
with EFF_CREATE, to make ef_open() accept the empty file.  Can't do
the same for empfile member nent.  Instead, make ef_open() not check
the (zero) size then.

Replaces commit 5750107b, v4.3.15.
include/file.h
src/lib/common/file.c
src/lib/common/filetable.c
src/lib/subs/fileinit.c
src/util/empdump.c
src/util/fairland.c
src/util/files.c