]> git.pond.sub.org Git - empserver/commit
edit: Report unit key 'U' failure more nicely, and avoid oops
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 27 Jan 2013 14:43:39 +0000 (15:43 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 6 Jun 2013 17:55:02 +0000 (19:55 +0200)
commit1f950f6a7099cdef9293e79153f39a278eac643a
treeddaa37986b51f5415ba2b2427365aa0304248313
parentccd436867915702890ea9340ddf1bd93b818d8e9
edit: Report unit key 'U' failure more nicely, and avoid oops

Two failure modes:

* When the argument is negative, edit() attempts an invalid write,
  triggering an oops.  edit() detects the write failure, and returns
  RET_FAIL.

  Detect the negative argument instead, and return RET_SYN, like we do
  for other invalid edit arguments.

* When the argument requires the table to be extended, but the
  extension fails, edit() returns RET_FAIL.

  Additionally report the failure to the player.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/commands/edit.c
tests/actofgod/journal.log
tests/actofgod/server.log