summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephane Glondu <steph@glondu.net>2019-09-07 20:10:46 +0200
committerStéphane Glondu <glondu@debian.org>2023-09-02 10:22:47 +0200
commit104f18d727f16f6be2056f0f1ff3b43cd7064f51 (patch)
tree1368442481e476a1bea8cdb2338921586e4c0d49
parentfa7aea2d4c5aad3b81ea9e4c691518ddfdaf32cd (diff)
Fix compilation with OCaml 4.08.0
Gbp-Pq: Name 0001-Fix-compilation-with-OCaml-4.08.0.patch
-rw-r--r--src/pa_ounit.ml7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pa_ounit.ml b/src/pa_ounit.ml
index 2ff8239..f8d975b 100644
--- a/src/pa_ounit.ml
+++ b/src/pa_ounit.ml
@@ -80,11 +80,12 @@ let rec short_desc_of_expr ~max_len = function
let s_short = String.sub s 0 (max_len - 5) in
s_short ^ "[...]"
else s in
- for i = 0 to String.length res -1 do
- if res.[i] = '\n' then
+ let res = Bytes.of_string res in
+ for i = 0 to Bytes.length res -1 do
+ if Bytes.get res i = '\n' then
res.[i] <- ' '
done;
- res
+ Bytes.to_string res
let descr _loc e_opt id_opt =
let filename = Loc.file_name _loc in