summaryrefslogtreecommitdiffstats
path: root/variable.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-20 01:09:54 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-20 01:09:54 +0000
commitca5c075b381c6bdde2a5fe8b3d0f8eded11b8178 (patch)
tree761073462f95269dc9da7bf70758e08f3169c593 /variable.c
parent87dc7ec05b96472168d234ffc09a4484390b1b42 (diff)
downloadruby-ca5c075b381c6bdde2a5fe8b3d0f8eded11b8178.tar.gz
ruby-ca5c075b381c6bdde2a5fe8b3d0f8eded11b8178.tar.xz
ruby-ca5c075b381c6bdde2a5fe8b3d0f8eded11b8178.zip
* variable.c (rb_class_path): need to adjust snprintf() len for
teminating NUL. [ruby-dev:26581] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/variable.c b/variable.c
index 7e56e8df8..34a978f25 100644
--- a/variable.c
+++ b/variable.c
@@ -208,7 +208,7 @@ rb_class_path(klass)
}
len = 2 + strlen(s) + 3 + 2 * SIZEOF_LONG + 1;
path = rb_str_new(0, len);
- snprintf(RSTRING(path)->ptr, len, "#<%s:0x%lx>", s, klass);
+ snprintf(RSTRING(path)->ptr, len+1, "#<%s:0x%lx>", s, klass);
RSTRING(path)->len = strlen(RSTRING(path)->ptr);
rb_ivar_set(klass, tmp_classpath, path);