Only look into lines with at least 2 chars

This commit is contained in:
tastytea 2022-03-16 16:32:15 +01:00
parent fe125532a4
commit 8949b857c4
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@ int main()
{
const auto line_nc{remove_colors(line)};
// Don't color +++ and --- lines
if (line_nc[2] != '+' && line_nc[2] != '-')
if (line.length() >= 2 && (line_nc[2] != '+' && line_nc[2] != '-'))
{
if (line_nc[1] == '+')
{