From 278c9e5e1722e17643cd1c42fe7bf2ec29962521 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 14 Jun 2023 16:35:03 +0200 Subject: [PATCH] use char_of_int --- lib/query.ml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/query.ml b/lib/query.ml index 45949cb..57f9a37 100644 --- a/lib/query.ml +++ b/lib/query.ml @@ -25,9 +25,8 @@ let encode_dns_name domain_name = let encoded_parts = List.map (fun part -> - let len_part = String.length part in - let len_byte = Char.chr len_part in - Bytes.cat (Bytes.of_string (String.make 1 len_byte)) (Bytes.of_string part)) + let len_part = char_of_int (String.length part) in + Bytes.cat (Bytes.of_string (String.make 1 len_part)) (Bytes.of_string part)) parts in Bytes.cat (Bytes.concat Bytes.empty encoded_parts) (Bytes.of_string "\x00")