diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-07-20 01:08:13 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-07-20 01:08:13 +0000 |
commit | 7617c58b71a00a8c447b606bd95539a791e02d7b (patch) | |
tree | 699d9b7a26df8a792c0358c6409240d233193dfe /variable.c | |
parent | f9f8b167d6eeb2b41d61e5f9ee91b98f9a74ea19 (diff) | |
download | ruby-7617c58b71a00a8c447b606bd95539a791e02d7b.tar.gz ruby-7617c58b71a00a8c447b606bd95539a791e02d7b.tar.xz ruby-7617c58b71a00a8c447b606bd95539a791e02d7b.zip |
* variable.c (rb_class_path): need to adjust snprintf() len for
teminating NUL. [ruby-dev:26581]
* error.c (syserr_initialize): don't use str before StringValue()
check. [ruby-dev:26579]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r-- | variable.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/variable.c b/variable.c index 02483fe8a..1139b016c 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); |