summaryrefslogtreecommitdiffstats
path: root/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/buffer.ml1
1 files changed, 1 insertions, 0 deletions
diff --git a/stdlib/buffer.ml b/stdlib/buffer.ml
index 63167d151..f020b836a 100644
--- a/stdlib/buffer.ml
+++ b/stdlib/buffer.ml
@@ -18,6 +18,7 @@ type t =
initial_buffer : string}
let create n =
+ if n <= 0 then invalid_arg "Buffer.create";
let s = String.create n in
{buffer = s; position = 0; length = String.length s; initial_buffer = s}