aboutsummaryrefslogtreecommitdiff
path: root/src/modules.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-01-15 22:28:45 +0000
committerGravatar Sadie Powell2023-01-15 22:28:45 +0000
commit769f9c0c340635cf401bdc92cb9a4c515ffeb0f3 (patch)
treee4bfe0849a5f47acdc1fce4b685209696641e48a /src/modules.cpp
parentFix cloaking users with a non-IP hostname when using hmac-sha256-ip. (diff)
Fix some issues reported by scan-build.
All of these are harmless and should never cause an issue in practise.
Diffstat (limited to 'src/modules.cpp')
-rw-r--r--src/modules.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index d6fff30c2..c391850f5 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -279,21 +279,27 @@ found_src:
// The modules registered for a hook are called in reverse order (to allow for easier removal
// of list entries while looping), meaning that the Priority given to us has the exact opposite effect
// on the list, e.g.: PRIORITY_BEFORE will actually put 'mod' after 'which', etc.
- size_t swap_pos = my_pos;
+ size_t swap_pos;
switch (s)
{
case PRIORITY_LAST:
+ {
if (prioritizationState != PRIO_STATE_FIRST)
return true;
- else
- swap_pos = 0;
+
+ swap_pos = 0;
break;
+ }
+
case PRIORITY_FIRST:
+ {
if (prioritizationState != PRIO_STATE_FIRST)
return true;
- else
- swap_pos = EventHandlers[i].size() - 1;
+
+ swap_pos = EventHandlers[i].size() - 1;
break;
+ }
+
case PRIORITY_BEFORE:
{
/* Find the latest possible position, only searching AFTER our position */
@@ -308,6 +314,7 @@ found_src:
// didn't find it - either not loaded or we're already after
return true;
}
+
/* Place this module before a set of other modules */
case PRIORITY_AFTER:
{
@@ -322,6 +329,9 @@ found_src:
// didn't find it - either not loaded or we're already before
return true;
}
+
+ default:
+ return true; // Should never happen.
}
swap_now: