summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index 36fe859aa1..8ae9cd475a 100644
--- a/string.c
+++ b/string.c
@@ -7820,7 +7820,7 @@ rb_str_justify(int argc, VALUE *argv, VALUE str, char jflag)
p += rlen2;
}
}
- *p = '\0';
+ TERM_FILL(p, rb_enc_mbminlen(enc));
STR_SET_LEN(res, p-RSTRING_PTR(res));
OBJ_INFECT(res, str);
if (!NIL_P(pad)) OBJ_INFECT(res, pad);