strlcpy(msg, message, sizeof(msg));
- while (start < msg + sizeof(msg))
+ while (*start)
{
+ assert(start >= msg && start < msg + sizeof(msg));
+
// Skip non nick
while (*start && !IsNickChar(*start))
++start;
const char *token = start;
- *end = 0; // null end of token
- start = end + 1; // proceed to next
+ if (*end)
+ {
+ *end = 0; // null end of token
+ start = end + 1; // proceed to next
+ }
+ else
+ {
+ start = end; // end loop
+ }
struct Client *target = hash_find_client(token);