1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/socket/option.c (inspect_timeval): fix the size test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2009-02-22 17:10:47 +00:00
parent e5dd6a792d
commit cdca4e19d0
2 changed files with 5 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Mon Feb 23 02:10:09 2009 Tanaka Akira <akr@fsij.org>
* ext/socket/option.c (inspect_timeval): fix the size test.
Sun Feb 22 22:42:20 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> Sun Feb 22 22:42:20 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (tr_trans): should recalculate coderange. * string.c (tr_trans): should recalculate coderange.

View file

@ -305,7 +305,7 @@ inspect_socktype(int level, int optname, VALUE data, VALUE ret)
static int static int
inspect_timeval(int level, int optname, VALUE data, VALUE ret) inspect_timeval(int level, int optname, VALUE data, VALUE ret)
{ {
if (RSTRING_LEN(data) == sizeof(struct linger)) { if (RSTRING_LEN(data) == sizeof(struct timeval)) {
struct timeval s; struct timeval s;
memcpy((char*)&s, RSTRING_PTR(data), sizeof(s)); memcpy((char*)&s, RSTRING_PTR(data), sizeof(s));
rb_str_catf(ret, " %ld.%06ldsec", (long)s.tv_sec, (long)s.tv_usec); rb_str_catf(ret, " %ld.%06ldsec", (long)s.tv_sec, (long)s.tv_usec);