Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for OCaml 4.06.0 (-safe-string is the default) #38

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix for OCaml 4.06.0 (-safe-string is the default)
vogler committed Nov 28, 2017
commit b4db1513b69592ea1573ba1ef686c62aaf5a0199
6 changes: 3 additions & 3 deletions src/formatlex.mll
Original file line number Diff line number Diff line change
@@ -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 =