diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-03-12 10:17:00 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-03-12 10:17:00 +0000 |
commit | a4b9c8334e2bc0698f0650d275be0935e86dc13e (patch) | |
tree | 5a2bffc54860203094bc81141989e53d4c62b7a8 | |
parent | 44bb459d7af7efad26540c9844b86f59088d3e13 (diff) | |
download | raindrops-a4b9c8334e2bc0698f0650d275be0935e86dc13e.tar.gz |
I thought my compiler would be smarter :<
-rw-r--r-- | ext/raindrops/linux_inet_diag.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/raindrops/linux_inet_diag.c b/ext/raindrops/linux_inet_diag.c index abc2ef9..4d3b399 100644 --- a/ext/raindrops/linux_inet_diag.c +++ b/ext/raindrops/linux_inet_diag.c @@ -317,6 +317,7 @@ static VALUE diag(void *ptr) while (1) { ssize_t readed; + size_t r; struct nlmsghdr *h = (struct nlmsghdr *)args->iov[0].iov_base; prep_msghdr(&msg, args, &nladdr, 1); @@ -329,8 +330,8 @@ static VALUE diag(void *ptr) } if (readed == 0) goto out; - - for ( ; NLMSG_OK(h, readed); h = NLMSG_NEXT(h, readed)) { + r = (size_t)readed; + for ( ; NLMSG_OK(h, r); h = NLMSG_NEXT(h, r)) { if (h->nlmsg_seq != seq) continue; if (h->nlmsg_type == NLMSG_DONE) |