summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--error.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 3640a30cbf..24ee768ee2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Jul 19 22:47:29 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * error.c (syserr_initialize): need to allocate an additional byte
+ for NUL at the end. [ruby-dev:26574]
+
Tue Jul 19 16:39:46 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (rb_io_inspect): replace sprintf() with "%s" format all
diff --git a/error.c b/error.c
index 0b63aa0512..7dacac8ce5 100644
--- a/error.c
+++ b/error.c
@@ -907,7 +907,7 @@ syserr_initialize(argc, argv, self)
else err = "unknown error";
if (!NIL_P(mesg)) {
VALUE str = mesg;
- size_t len = strlen(err)+RSTRING(str)->len+3;
+ size_t len = strlen(err)+RSTRING(str)->len+4;
StringValue(str);
mesg = rb_str_new(0, len);
snprintf(RSTRING(mesg)->ptr, len, "%s - %.*s", err,