Skip to content

Commit

Permalink
Fix compilation with newer base64 versions
Browse files Browse the repository at this point in the history
  • Loading branch information
vbmithr authored and alavrik committed Feb 20, 2019
1 parent 40c2010 commit 98abdbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion opam
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ depends: [
"easy-format"
"ulex"
"xmlm"
"base64" {>="2.0.0"}
"base64" {>="3.1.0"}
]
dev-repo: "git://github.com/alavrik/piqi"
9 changes: 4 additions & 5 deletions piqilib/piqi_base64.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
(* TODO: add more base64 validation; the base64 library doesn't do any
* validation *)
let decode x =
try
B64.decode x
with _ ->
invalid_arg "Piqi_base64.decode"
match Base64.decode x with
| Error _ -> invalid_arg "Piqi_base64.decode"
| Ok v -> v


let encode x =
B64.encode x
Base64.encode_exn x

0 comments on commit 98abdbf

Please sign in to comment.