never crash
This commit is contained in:
parent
abcbd1754c
commit
24860a540f
1 changed files with 6 additions and 6 deletions
|
@ -31,11 +31,11 @@
|
||||||
| "\\\"" -> Some '"'
|
| "\\\"" -> Some '"'
|
||||||
| "\\\\" -> Some '\\'
|
| "\\\\" -> Some '\\'
|
||||||
| _ ->
|
| _ ->
|
||||||
(match String.get data 1 with
|
(try
|
||||||
| '0' | '1' | '2' ->
|
|
||||||
let caractere = String.sub data 1 (String.length data - 1) in
|
let caractere = String.sub data 1 (String.length data - 1) in
|
||||||
let ascii_code = int_of_string caractere in
|
let ascii_code = int_of_string caractere in
|
||||||
Some (Char.chr ascii_code)
|
Some (Char.chr ascii_code)
|
||||||
|
with
|
||||||
| _ -> None)
|
| _ -> None)
|
||||||
;;
|
;;
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue