use char_of_int
This commit is contained in:
parent
2fa8f1083b
commit
278c9e5e17
1 changed files with 2 additions and 3 deletions
|
@ -25,9 +25,8 @@ let encode_dns_name domain_name =
|
||||||
let encoded_parts =
|
let encoded_parts =
|
||||||
List.map
|
List.map
|
||||||
(fun part ->
|
(fun part ->
|
||||||
let len_part = String.length part in
|
let len_part = char_of_int (String.length part) in
|
||||||
let len_byte = Char.chr len_part in
|
Bytes.cat (Bytes.of_string (String.make 1 len_part)) (Bytes.of_string part))
|
||||||
Bytes.cat (Bytes.of_string (String.make 1 len_byte)) (Bytes.of_string part))
|
|
||||||
parts
|
parts
|
||||||
in
|
in
|
||||||
Bytes.cat (Bytes.concat Bytes.empty encoded_parts) (Bytes.of_string "\x00")
|
Bytes.cat (Bytes.concat Bytes.empty encoded_parts) (Bytes.of_string "\x00")
|
||||||
|
|
Reference in a new issue