Automatically stop most user-oriented hooks if the user becomes dead.
[srvx.git] / src / nickserv.c
index 6717a5674b900cf93cec52434da83a5ce00cbf65..7df54b1703631f2c30920b6ce6affd45b7456254 100644 (file)
@@ -1,5 +1,5 @@
 /* nickserv.c - Nick/authentication service
- * Copyright 2000-2006 srvx Development Team
+ * Copyright 2000-2008 srvx Development Team
  *
  * This file is part of srvx.
  *
@@ -935,7 +935,7 @@ set_user_handle_info(struct userNode *user, struct handle_info *hi, int stamp)
     user->handle_info = hi;
     if (hi && !hi->users && !hi->opserv_level)
         HANDLE_CLEAR_FLAG(hi, HELPING);
-    for (n=0; n<auth_func_used; n++)
+    for (n=0; (n<auth_func_used) && !user->dead; n++)
         auth_func_list[n](user, old_info);
     if (hi) {
         struct nick_info *ni;
@@ -3728,8 +3728,7 @@ nickserv_load_dict(const char *fname)
         log_module(NS_LOG, LOG_ERROR, "Unable to open dictionary file %s: %s", fname, strerror(errno));
         return;
     }
-    while (!feof(file)) {
-        fgets(line, sizeof(line), file);
+    while (fgets(line, sizeof(line), file)) {
         if (!line[0])
             continue;
         if (line[strlen(line)-1] == '\n')