diff options
author | Guy Harris <guy@alum.mit.edu> | 2012-12-26 06:56:17 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-12-26 06:56:17 +0000 |
commit | 6d678c20d6e78052f91a13d6f0922e99de5f8174 (patch) | |
tree | 14e24abfc823ee3d06a515dca585e1e8917810f6 /wiretap/iseries.c | |
parent | 7f40879104fbe5fd232ac385e8156a0934d93fea (diff) | |
download | wireshark-6d678c20d6e78052f91a13d6f0922e99de5f8174.tar.gz |
OK, does *this* convince the compiler that the loop isn't ever going to
be infinite?
svn path=/trunk/; revision=46757
Diffstat (limited to 'wiretap/iseries.c')
-rw-r--r-- | wiretap/iseries.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/wiretap/iseries.c b/wiretap/iseries.c index e2b2bb2e39..eedb2ef1ff 100644 --- a/wiretap/iseries.c +++ b/wiretap/iseries.c @@ -953,11 +953,8 @@ iseries_parse_hex_string (const char * ascii, guint8 * buf, size_t len) guint8 bytevalue; byte = 0; - i = 0; - for (;;) + for (i = 0; i < len; i++) { - if (i >= len) - break; hexvalue = g_ascii_xdigit_value(ascii[i]); i++; if (hexvalue == -1) @@ -966,7 +963,6 @@ iseries_parse_hex_string (const char * ascii, guint8 * buf, size_t len) if (i >= len) return FALSE; /* only one hex digit of the byte is present */ hexvalue = g_ascii_xdigit_value(ascii[i]); - i++; if (hexvalue == -1) return FALSE; /* not a valid hex digit */ bytevalue |= (guint8) hexvalue; |