Skip to content

Commit 2e1b0c1

Browse files
committed
Avoid index out of range
1 parent f6c0098 commit 2e1b0c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

colorable_windows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ loop:
719719
n256setup()
720720
}
721721
attr &= backgroundMask
722-
attr |= n256foreAttr[n256]
722+
attr |= n256foreAttr[n256%len(n256foreAttr)]
723723
i += 2
724724
}
725725
} else if len(token) == 5 && token[i+1] == "2" {
@@ -761,7 +761,7 @@ loop:
761761
n256setup()
762762
}
763763
attr &= foregroundMask
764-
attr |= n256backAttr[n256]
764+
attr |= n256backAttr[n256%len(n256backAttr)]
765765
i += 2
766766
}
767767
} else if len(token) == 5 && token[i+1] == "2" {

0 commit comments

Comments
 (0)