summaryrefslogtreecommitdiff
path: root/net.c
diff options
context:
space:
mode:
authorJohn Hughes <john@Calva.COM>2002-05-24 10:19:44 +0000
committerJohn Hughes <john@Calva.COM>2002-05-24 10:19:44 +0000
commit2c4e3a8061130493bd196564f096b677c5528fc1 (patch)
tree00288717989dffe3707d92479df598eba2b8d39b /net.c
parent38ae88d332acd9f86a30d58158e306d795d98977 (diff)
downloadstrace-2c4e3a8061130493bd196564f096b677c5528fc1.tar.gz
fix unsigned arithmetic bug in previous change
Diffstat (limited to 'net.c')
-rw-r--r--net.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net.c b/net.c
index 34659803c..5ab0d6755 100644
--- a/net.c
+++ b/net.c
@@ -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) {