Don't try to look into the third char if the line is < 3 chars
This commit is contained in:
parent
8949b857c4
commit
e8b74d10d1
|
@ -54,7 +54,8 @@ int main()
|
||||||
{
|
{
|
||||||
const auto line_nc{remove_colors(line)};
|
const auto line_nc{remove_colors(line)};
|
||||||
// Don't color +++ and --- lines
|
// Don't color +++ and --- lines
|
||||||
if (line.length() >= 2 && (line_nc[2] != '+' && line_nc[2] != '-'))
|
if (line.length() >= 2
|
||||||
|
&& (line.length() < 3 || (line_nc[2] != '+' && line_nc[2] != '-')))
|
||||||
{
|
{
|
||||||
if (line_nc[1] == '+')
|
if (line_nc[1] == '+')
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user