aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r--lib/stdlib/src/io_lib_format.erl4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/stdlib/src/io_lib_format.erl b/lib/stdlib/src/io_lib_format.erl
index eb1885021d..7c04d78ce8 100644
--- a/lib/stdlib/src/io_lib_format.erl
+++ b/lib/stdlib/src/io_lib_format.erl
@@ -573,9 +573,7 @@ string(S, F, Adj, F, Pad) ->
string(S, none, Adj, F, Pad);
string(S, F, Adj, P, Pad) when F > P ->
N = lists:flatlength(S),
- if N > F -> flat_trunc(S, F);
- N =:= F -> S;
- N > P -> adjust(flat_trunc(S, P), chars(Pad, F-P), Adj);
+ if N > P -> adjust(flat_trunc(S, P), chars(Pad, F-P), Adj);
N =:= P -> adjust(S, chars(Pad, F-P), Adj);
true -> adjust([S|chars(Pad, P-N)], chars(Pad, F-P), Adj)
end.