Skip to content

Commit

Permalink
Avoid index out of range
Browse files Browse the repository at this point in the history
  • Loading branch information
mattn committed Oct 3, 2020
1 parent f6c0098 commit 2e1b0c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions colorable_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ loop:
n256setup()
}
attr &= backgroundMask
attr |= n256foreAttr[n256]
attr |= n256foreAttr[n256%len(n256foreAttr)]
i += 2
}
} else if len(token) == 5 && token[i+1] == "2" {
Expand Down Expand Up @@ -761,7 +761,7 @@ loop:
n256setup()
}
attr &= foregroundMask
attr |= n256backAttr[n256]
attr |= n256backAttr[n256%len(n256backAttr)]
i += 2
}
} else if len(token) == 5 && token[i+1] == "2" {
Expand Down

0 comments on commit 2e1b0c1

Please sign in to comment.