mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 01:05:48 +02:00
More CodeQL fixes
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"unicode/utf8"
|
||||
)
|
||||
|
||||
var _ = fmt.Print
|
||||
@@ -59,8 +60,9 @@ func StringLiteral(val string) (string, error) {
|
||||
var state State
|
||||
decode := func(base int) {
|
||||
text := string(buf[:bufcount])
|
||||
num, _ := strconv.ParseUint(text, base, 32)
|
||||
ans.WriteRune(rune(num))
|
||||
if num, err := strconv.ParseUint(text, base, 32); err == nil && num <= utf8.MaxRune {
|
||||
ans.WriteRune(rune(num))
|
||||
}
|
||||
state = normal
|
||||
bufcount = 0
|
||||
buflimit = 0
|
||||
|
||||
Reference in New Issue
Block a user