if (blah) ...

From: Chris Proctor (cjp@minotaur.labyrinth.net.au)
Date: 08/11/99


Hi all,

Noticed an odd thing happening with some of my code (and some stock) since
moving servers.
The common construct:
if (blah)
   do this;
else
   do something else;

Doesn't seem to work correctly.
Occasionally it will do "this" instead of "something else" even if "blah"
is negative or null.

I've been fixing up bits of code as I notice them, using:

if (blah != NULL)
   do this;
else
   do something else;

or if (blah > 0), depending on what type of variable blah is.

This has caused the most problems in mobact.c, apparently, but was also
crashing the mud in do_disconnect and a few other places.

Anyone know why this would suddenly have started happening? Is it to do
with versions of compilers, operating systems, or something else entirely?
Regards,
Chris Proctor (Deathblade, Implementor of DominiaMUD)
MUD Homepage: http://www.labyrinth.net.au/~cjp


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST