diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-08 04:30:30 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-08 04:30:30 +0000 |
commit | 3df8fbf2481e4aacf7619f37309060fde72b0fdc (patch) | |
tree | 33b97a983b6f780f8bc9108b30b71f93b2163e7c /process.c | |
parent | 9e33b72ad154eeb5fb1ff257d90340a1ae767df1 (diff) | |
download | ruby-3df8fbf2481e4aacf7619f37309060fde72b0fdc.tar.gz |
process.c: need capacity
* process.c (obj2uid, obj2gid): need capacity as buffer size, not
length.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -4738,7 +4738,8 @@ obj2uid(VALUE id getpw_buf = rb_alloc_tmp_buffer(getpw_tmp, getpw_buf_len); } else { - RSTRING_GETMEM(*getpw_tmp, getpw_buf, getpw_buf_len); + getpw_buf = RSTRING_PTR(*getpw_tmp); + getpw_buf_len = rb_str_capacity(*getpw_tmp); } if (getpwnam_r(usrname, &pwbuf, getpw_buf, getpw_buf_len, &pwptr)) rb_sys_fail("getpwnam_r"); @@ -4806,7 +4807,8 @@ obj2gid(VALUE id getgr_buf = rb_alloc_tmp_buffer(getgr_tmp, getgr_buf_len); } else { - RSTRING_GETMEM(*getgr_tmp, getgr_buf, getgr_buf_len); + getgr_buf = RSTRING_PTR(*getgr_tmp); + getgr_buf_len = rb_str_capacity(*getgr_tmp); } if (getgrnam_r(grpname, &grbuf, getgr_buf, getgr_buf_len, &grptr)) rb_sys_fail("getgrnam_r"); |