Skip to content

Commit

Permalink
fix for OCaml 4.06.0 (-safe-string is the default)
Browse files Browse the repository at this point in the history
  • Loading branch information
vogler committed Nov 28, 2017
1 parent 936b041 commit b4db151
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/formatlex.mll
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ let scan_oct_escape str =
* We convert L"Hi" to "H\000i\000" *)
let wbtowc wstr =
let len = String.length wstr in
let dest = String.make (len * 2) '\000' in
let dest = Bytes.make (len * 2) '\000' in
for i = 0 to len-1 do
dest.[i*2] <- wstr.[i] ;
Bytes.set dest (i*2) (String.get wstr i)
done ;
dest
Bytes.to_string dest

(* This function converst the "Hi" in L"Hi" to { L'H', L'i', L'\0' } *)
let wstr_to_warray wstr =
Expand Down

0 comments on commit b4db151

Please sign in to comment.