summaryrefslogtreecommitdiffstats
path: root/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/printf.ml2
1 files changed, 1 insertions, 1 deletions
diff --git a/stdlib/printf.ml b/stdlib/printf.ml
index c8c336203..740758116 100644
--- a/stdlib/printf.ml
+++ b/stdlib/printf.ml
@@ -41,7 +41,7 @@ let parse_format format =
on the right if [neg] is true, on the left otherwise. *)
let pad_string pad_char p neg s i len =
if p = len && i = 0 then s else
- if p <= len then String.sub s i p else
+ if p <= len then String.sub s i len else
let res = String.make p pad_char in
if neg
then String.blit s i res 0 len