Skip to content

Commit

Permalink
Added check for array boundaries
Browse files Browse the repository at this point in the history
  • Loading branch information
noborus committed Dec 2, 2020
1 parent bb7e37d commit a8cd61d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion oviewer/move.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ func (root *Root) moveNumUp(hight int) {
}
n = len(startX)
}
x = startX[n-1]
if n > 0 {
x = startX[n-1]
} else {
x = 0
}
n--
}
root.Doc.lineNum = num - root.Doc.Header
Expand Down

0 comments on commit a8cd61d

Please sign in to comment.