Skip to content

Commit 788345a

Browse files
committed
fixed mistake in escaping control chars
1 parent a5e2f25 commit 788345a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

parser.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,19 +281,19 @@ func escapeString(dst []byte, s string) []byte {
281281
// default, rest are control chars
282282
dst = append(dst, c)
283283
case c < 0x09:
284-
dst = append(dst, []byte{92, 117, 48, 48, 48 + c, 48}...)
284+
dst = append(dst, []byte{92, 117, 48, 48, 48, 48 + c}...)
285285
case c == 0x09:
286286
dst = append(dst, []byte{92, 116}...)
287287
case c == 0x0a:
288288
dst = append(dst, []byte{92, 110}...)
289289
case c == 0x0d:
290290
dst = append(dst, []byte{92, 114}...)
291291
case c < 0x10:
292-
dst = append(dst, []byte{92, 117, 48, 48, 87 + c, 48}...)
292+
dst = append(dst, []byte{92, 117, 48, 48, 48, 87 + c}...)
293293
case c < 0x1a:
294-
dst = append(dst, []byte{92, 117, 48, 49, 32 + c, 48}...)
294+
dst = append(dst, []byte{92, 117, 48, 48, 49, 32 + c}...)
295295
case c < 0x20:
296-
dst = append(dst, []byte{92, 117, 48, 49, 71 + c, 48}...)
296+
dst = append(dst, []byte{92, 117, 48, 48, 49, 71 + c}...)
297297
}
298298
}
299299
dst = append(dst, 34)

0 commit comments

Comments
 (0)