File: 0002-Fix-compilation-with-safe-string.patch

package info (click to toggle)
ocamlify 0.0.2-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 668 kB
  • sloc: ml: 5,636; makefile: 50
file content (26 lines) | stat: -rw-r--r-- 625 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From: Stephane Glondu <steph@glondu.net>
Date: Wed, 14 Aug 2019 10:58:46 +0200
Subject: Fix compilation with -safe-string

---
 setup.ml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/setup.ml b/setup.ml
index 387ae0e..025b420 100644
--- a/setup.ml
+++ b/setup.ml
@@ -227,11 +227,11 @@ module OASISString = struct
       raise Not_found
 
   let replace_chars f s =
-    let buf = String.make (String.length s) 'X' in
+    let buf = Bytes.make (String.length s) 'X' in
       for i = 0 to String.length s - 1 do
         buf.[i] <- f s.[i]
       done;
-      buf
+      Bytes.to_string buf
 
 end