diff --git a/channels/irc/src/main.rs b/channels/irc/src/main.rs index 27aae5d..4b20284 100644 --- a/channels/irc/src/main.rs +++ b/channels/irc/src/main.rs @@ -260,7 +260,7 @@ impl State { while i > 0 && !remaining.is_char_boundary(i) { i -= 1; } // To avoid splitting mid-word, see if there was a space recently let mut j = i; - while j > 0 && j > i-10 && remaining.as_bytes()[j] != b' ' { j -= 1; } + while j > 1 && j > i-10 && remaining.as_bytes()[j] != b' ' { j -= 1; } if remaining.as_bytes()[j] == b' ' { j } else if i == 0 { max_msg } else { i } };