diff options
| author | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2001-05-07 10:08:57 +0000 |
|---|---|---|
| committer | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2001-05-07 10:08:57 +0000 |
| commit | 838984dd5b89aa690c25d52fa10e9d6bbc402ff4 (patch) | |
| tree | 53734252b28e559502e59421120869cdffb6cb3c /stdlib/pervasives.ml | |
| parent | 4d57d77bf1f5a732e280b582e5fb9d5709bae9ac (diff) | |
| download | ocaml-838984dd5b89aa690c25d52fa10e9d6bbc402ff4.tar.gz | |
Try switching libraries to strict labels
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/strict_labels@3498 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'stdlib/pervasives.ml')
| -rw-r--r-- | stdlib/pervasives.ml | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/stdlib/pervasives.ml b/stdlib/pervasives.ml index 58408aace7..eb121fed69 100644 --- a/stdlib/pervasives.ml +++ b/stdlib/pervasives.ml @@ -228,6 +228,11 @@ let output oc s ofs len = then invalid_arg "output" else unsafe_output oc s ofs len +let output' oc ~buf:s ~pos:ofs ~len = + if ofs < 0 || len < 0 || ofs + len > string_length s + then invalid_arg "output" + else unsafe_output oc s ofs len + external output_byte : out_channel -> int -> unit = "caml_output_char" external output_binary_int : out_channel -> int -> unit = "caml_output_int" @@ -264,6 +269,11 @@ let input ic s ofs len = then invalid_arg "input" else unsafe_input ic s ofs len +let input' ic ~buf:s ~pos:ofs ~len = + if ofs < 0 || len < 0 || ofs + len > string_length s + then invalid_arg "input" + else unsafe_input ic s ofs len + let rec unsafe_really_input ic s ofs len = if len <= 0 then () else begin let r = unsafe_input ic s ofs len in |
