diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2017-11-21 20:23:59 +0100 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2017-11-21 20:30:12 +0100 |
commit | a7a76012a129ffefb64f102948db63fbc715e45e (patch) | |
tree | 3e02d247b7a74c7fcd82e7f7f1adccd4b5e2277e /print-pgm.c | |
parent | f7606784dba04b65edbd2f1582465aab2266ce7f (diff) | |
download | tcpdump-a7a76012a129ffefb64f102948db63fbc715e45e.tar.gz |
Use more the EXTRACT_8BITS() macro to fetch a one-byte value (17/n)
Assignment, *p++ -> EXTRACT_8BITS(p); p++;
Partial list.
Diffstat (limited to 'print-pgm.c')
-rw-r--r-- | print-pgm.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/print-pgm.c b/print-pgm.c index e2d721c1..94f3465b 100644 --- a/print-pgm.c +++ b/print-pgm.c @@ -433,12 +433,14 @@ pgm_print(netdissect_options *ndo, * That option header MUST be an OPT_LENGTH option * (see the first paragraph of section 9.1 in RFC 3208). */ - opt_type = *bp++; + opt_type = EXTRACT_8BITS(bp); + bp++; if ((opt_type & PGM_OPT_MASK) != PGM_OPT_LENGTH) { ND_PRINT((ndo, "[First option bad, should be PGM_OPT_LENGTH, is %u]", opt_type & PGM_OPT_MASK)); return; } - opt_len = *bp++; + opt_len = EXTRACT_8BITS(bp); + bp++; if (opt_len != 4) { ND_PRINT((ndo, "[Bad OPT_LENGTH option, length %u != 4]", opt_len)); return; @@ -461,8 +463,10 @@ pgm_print(netdissect_options *ndo, ND_PRINT((ndo, " [|OPT]")); return; } - opt_type = *bp++; - opt_len = *bp++; + opt_type = EXTRACT_8BITS(bp); + bp++; + opt_len = EXTRACT_8BITS(bp); + bp++; if (opt_len < PGM_MIN_OPT_LEN) { ND_PRINT((ndo, "[Bad option, length %u < %u]", opt_len, PGM_MIN_OPT_LEN)); |