fixed crash when receiving notify messages
[lcr.git] / cause.c
diff --git a/cause.c b/cause.c
index 42fdb29..825daaa 100644 (file)
--- a/cause.c
+++ b/cause.c
@@ -405,9 +405,14 @@ void collect_cause(int *multicause, int *multilocation, int newcause, int newloc
                *multicause = newcause;
                *multilocation = newlocation;
        } else
-       if (newcause==CAUSE_NOUSER && *multicause==CAUSE_NOUSER) /* cause 18, but no cause yet, use the location */
+       if (newcause==CAUSE_NOUSER && *multicause==CAUSE_NOUSER) /* cause 18, use the location */
        {
                *multilocation = newlocation;
+       } else
+       if (*multicause==0) /* no cause yet, use newcause (should be 18) */
+       {
+               *multicause = newcause;
+               *multilocation = newlocation;
        }
 }