diff options
author | John Hughes <john@Calva.COM> | 2002-05-24 10:19:44 +0000 |
---|---|---|
committer | John Hughes <john@Calva.COM> | 2002-05-24 10:19:44 +0000 |
commit | 2c4e3a8061130493bd196564f096b677c5528fc1 (patch) | |
tree | 00288717989dffe3707d92479df598eba2b8d39b /net.c | |
parent | 38ae88d332acd9f86a30d58158e306d795d98977 (diff) | |
download | strace-2c4e3a8061130493bd196564f096b677c5528fc1.tar.gz |
fix unsigned arithmetic bug in previous change
Diffstat (limited to 'net.c')
-rw-r--r-- | net.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1436,7 +1436,7 @@ int len; int c = 0; struct opthdr hdr; - while (len >= sizeof hdr) { + while (len >= (int) sizeof hdr) { if (umove(tcp, addr, &hdr) < 0) break; if (c++) { tprintf (", "); @@ -1448,8 +1448,10 @@ int len; addr += sizeof hdr; len -= sizeof hdr; printsockopt (tcp, hdr.level, hdr.name, addr, hdr.len); - addr += hdr.len; - len -= hdr.len; + if (hdr.len > 0) { + addr += hdr.len; + len -= hdr.len; + } tprintf ("}"); } if (len > 0) { |