Skip to content

Commit c4c4d6d

Browse files
committed
Handle not finding a tag in message
1 parent ff71fe7 commit c4c4d6d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

rfc3164/rfc3164.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@ func (p *Parser) parseTag() (string, error) {
189189
from := p.cursor
190190

191191
for {
192+
if p.cursor == p.l {
193+
// no tag found, reset cursor for content
194+
p.cursor = from
195+
return "", nil
196+
}
197+
192198
b = p.buff[p.cursor]
193199
bracketOpen = (b == '[')
194200
endOfTag = (b == ':' || b == ' ')

0 commit comments

Comments
 (0)