summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/m_watch.c3
-rw-r--r--src/watch.c6
2 files changed, 5 insertions, 4 deletions
diff --git a/modules/m_watch.c b/modules/m_watch.c
index 1c84613..7841f78 100644
--- a/modules/m_watch.c
+++ b/modules/m_watch.c
@@ -103,7 +103,8 @@ m_watch(struct Client *client_p, struct Client *source_p, int parc, char *parv[]
continue;
}
- watch_add_to_hash_table(s + 1, source_p);
+ if (valid_nickname(s + 1, 1))
+ watch_add_to_hash_table(s + 1, source_p);
}
show_watch(source_p, s + 1, RPL_NOWON, RPL_NOWOFF);
diff --git a/src/watch.c b/src/watch.c
index cdc859d..b3aff72 100644
--- a/src/watch.c
+++ b/src/watch.c
@@ -142,7 +142,7 @@ watch_add_to_hash_table(const char *nick, struct Client *client_p)
anptr->lasttime = CurrentTime;
strlcpy(anptr->nick, nick, sizeof(anptr->nick));
- dlinkAdd(anptr, &anptr->node, &watchTable[strhash(nick)]);
+ dlinkAdd(anptr, &anptr->node, &watchTable[strhash(anptr->nick)]);
}
else
{
@@ -183,8 +183,8 @@ watch_del_from_hash_table(const char *nick, struct Client *client_p)
/* In case this header is now empty of notices, remove it */
if (anptr->watched_by.head == NULL)
{
- assert(dlinkFind(&watchTable[strhash(nick)], anptr) != NULL);
- dlinkDelete(&anptr->node, &watchTable[strhash(nick)]);
+ assert(dlinkFind(&watchTable[strhash(anptr->nick)], anptr) != NULL);
+ dlinkDelete(&anptr->node, &watchTable[strhash(anptr->nick)]);
mp_pool_release(anptr);
}
}