diff options
author | Luc Maranget <luc.maranget@inria.fr> | 2010-01-25 14:52:00 +0000 |
---|---|---|
committer | Luc Maranget <luc.maranget@inria.fr> | 2010-01-25 14:52:00 +0000 |
commit | e7ada9b93a02d39cd62f6fd7d9f629429ef51273 (patch) | |
tree | 0d5771c12e6ab43afb23e5976c1ab35686a66b30 /stdlib/buffer.ml | |
parent | 924e832b687e914f4173bb52ec39806b1b6192a8 (diff) | |
download | ocaml-jo311.tar.gz |
Preparing relase 3.11.2jo311
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/jo311@9590 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'stdlib/buffer.ml')
-rw-r--r-- | stdlib/buffer.ml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/stdlib/buffer.ml b/stdlib/buffer.ml index 8dfe875993..0888409813 100644 --- a/stdlib/buffer.ml +++ b/stdlib/buffer.ml @@ -39,6 +39,14 @@ let sub b ofs len = end ;; +let blit src srcoff dst dstoff len = + if len < 0 || srcoff < 0 || srcoff > src.position - len + || dstoff < 0 || dstoff > (String.length dst) - len + then invalid_arg "Buffer.blit" + else + String.blit src.buffer srcoff dst dstoff len +;; + let nth b ofs = if ofs < 0 || ofs >= b.position then invalid_arg "Buffer.nth" |