From 8949b857c4c03af18e141f662c44fcf064d80f9e Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 16 Mar 2022 16:32:15 +0100 Subject: [PATCH] Only look into lines with at least 2 chars --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 0101119..f4370cb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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] == '+') {