mirror of
https://github.com/go-delve/delve.git
synced 2025-10-28 04:35:19 +08:00
terminal/command: stack command panics when stack has 1 frame
Insure that the digits function always returns at least 1. Fixes #354 (partial)
This commit is contained in:
@ -819,6 +819,9 @@ func (c *Commands) sourceCommand(t *Term, args string) error {
|
||||
}
|
||||
|
||||
func digits(n int) int {
|
||||
if n <= 0 {
|
||||
return 1
|
||||
}
|
||||
return int(math.Floor(math.Log10(float64(n)))) + 1
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user