mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
driver: Bug fix: (Key).String might cause infinite loop
This commit is contained in:
parent
2e49ed5402
commit
33e850a6d4
@ -437,7 +437,7 @@ func (k Key) String() string {
|
||||
{{range $index, $name := .DriverKeyNames}}case Key{{$name}}:
|
||||
return {{$name | printf "Key%s" | printf "%q"}}
|
||||
{{end}}}
|
||||
panic(fmt.Sprintf("driver: invalid key: %v", k))
|
||||
panic(fmt.Sprintf("driver: invalid key: %d", k))
|
||||
}
|
||||
`
|
||||
|
||||
|
@ -340,5 +340,5 @@ func (k Key) String() string {
|
||||
case KeyUp:
|
||||
return "KeyUp"
|
||||
}
|
||||
panic(fmt.Sprintf("driver: invalid key: %v", k))
|
||||
panic(fmt.Sprintf("driver: invalid key: %d", k))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user