Limit percent value from 0 to 100.

This commit is contained in:
Sven Weidauer 2021-01-01 15:18:16 +01:00
parent 04943d8f63
commit 8262760bc7

View file

@ -182,6 +182,7 @@ extension Scanner {
} }
if string("%") { if string("%") {
guard 0...100 ~= int else { return nil }
int = int * 0xFF / 100 int = int * 0xFF / 100
} }