mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 03:58:55 +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}}:
|
{{range $index, $name := .DriverKeyNames}}case Key{{$name}}:
|
||||||
return {{$name | printf "Key%s" | printf "%q"}}
|
return {{$name | printf "Key%s" | printf "%q"}}
|
||||||
{{end}}}
|
{{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:
|
case KeyUp:
|
||||||
return "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