]> jfr.im git - solanum.git/blobdiff - ircd/hook.c
Replace most checks for +o with oper:general
[solanum.git] / ircd / hook.c
index bda9fc0cce8a5172b047c2bf86fcb9e4346aad64..2721a35cb3daadd43b9fd4fba959f67400081790 100644 (file)
@@ -198,10 +198,10 @@ add_hook_prio(const char *name, hookfn fn, enum hook_priority priority)
        entry->fn = fn;
        entry->priority = priority;
 
-       RB_DLINK_FOREACH(ptr, &hooks[i].hooks.head)
+       RB_DLINK_FOREACH(ptr, hooks[i].hooks.head)
        {
                struct hook_entry *o = ptr->data;
-               if (entry->priority < o->priority)
+               if (entry->priority <= o->priority)
                {
                        rb_dlinkAddBefore(ptr, entry, &entry->node, &hooks[i].hooks);
                        return;
@@ -223,7 +223,7 @@ remove_hook(const char *name, hookfn fn)
        if((i = find_hook(name)) < 0)
                return;
 
-       RB_DLINK_FOREACH_SAFE(ptr, scratch, &hooks[i].hooks.head)
+       RB_DLINK_FOREACH_SAFE(ptr, scratch, hooks[i].hooks.head)
        {
                struct hook_entry *entry = ptr->data;
                if (entry->fn == fn)