summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'error.c')
-rw-r--r--error.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/error.c b/error.c
index c67fce9d34..f4fbb10511 100644
--- a/error.c
+++ b/error.c
@@ -908,7 +908,7 @@ syserr_initialize(argc, argv, self)
if (!NIL_P(mesg)) {
VALUE str = mesg;
StringValue(str);
- mesg = rb_str_new(0, strlen(err)+RSTRING(mesg)->len+3);
+ mesg = rb_str_new(0, strlen(err)+RSTRING(str)->len+3);
sprintf(RSTRING(mesg)->ptr, "%s - %.*s", err,
(int)RSTRING(str)->len, RSTRING(str)->ptr);
rb_str_resize(mesg, strlen(RSTRING(mesg)->ptr));