[BUG] [CODE] db.c in load_zone

From: John (witpens@optushome.com.au)
Date: 11/11/01


I have come across something really bizarre when I tried adding a new
zone command. The mud has loaded before I added this command, but now,
it comes up with the error BEFORE it even reaches the new command and
upon looking further, I found this very strange bug that should have
caused the unmodified code to not load as well!

if (strchr("MOEPD", ZCMD.command) == NULL) { /* a 3-arg command */
      if (sscanf(ptr, " %d %d %d ", &tmp, &ZCMD.arg1, &ZCMD.arg2) != 3)
 error = 1;
    } else {
      if (sscanf(ptr, " %d %d %d %d ", &tmp, &ZCMD.arg1, &ZCMD.arg2,
   &ZCMD.arg3) != 4)
 error = 1;
    }

I have always thought that zone commands "MOEPD" has FOUR arguments!!!!
and the rest has THREE arguments!!! The above checks in db.c has this
reversed.

Now puff wont even load. The weird thing is, it loaded before I did any
changes to this. This is very perplexing, unless I am a total idiot
trying to code at 5am.

If my assumption is correct, then error = 1 will be returned, and then a
SYSERR occurs. So what gives?

Help!!

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST