etheraddr_string(netdissect_options *ndo, const uint8_t *ep)
{
int i;
+ uint8_t octet;
char *cp;
struct enamemem *tp;
int oui;
#endif
cp = buf;
oui = EXTRACT_BE_U_3(ep);
- *cp++ = hex[*ep >> 4 ];
- *cp++ = hex[*ep++ & 0xf];
+ octet = *ep++;
+ *cp++ = hex[octet >> 4];
+ *cp++ = hex[octet & 0xf];
for (i = 5; --i >= 0;) {
*cp++ = ':';
- *cp++ = hex[*ep >> 4 ];
- *cp++ = hex[*ep++ & 0xf];
+ octet = *ep++;
+ *cp++ = hex[octet >> 4];
+ *cp++ = hex[octet & 0xf];
}
if (!ndo->ndo_nflag) {
{
const unsigned int len = 8;
u_int i;
+ uint8_t octet;
char *cp;
struct bsnamemem *tp;
char buf[BUFSIZE];
cp = buf;
for (i = len; i > 0 ; --i) {
- *cp++ = hex[*(ep + i - 1) >> 4];
- *cp++ = hex[*(ep + i - 1) & 0xf];
+ octet = *(ep + i - 1);
+ *cp++ = hex[octet >> 4];
+ *cp++ = hex[octet & 0xf];
*cp++ = ':';
}
cp --;
const unsigned int type, const unsigned int len)
{
u_int i;
+ uint8_t octet;
char *cp;
struct bsnamemem *tp;
if (tp->bs_name == NULL)
(*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC,
"linkaddr_string: malloc");
- *cp++ = hex[*ep >> 4];
- *cp++ = hex[*ep++ & 0xf];
+ octet = *ep++;
+ *cp++ = hex[octet >> 4];
+ *cp++ = hex[octet & 0xf];
for (i = len-1; i > 0 ; --i) {
*cp++ = ':';
- *cp++ = hex[*ep >> 4];
- *cp++ = hex[*ep++ & 0xf];
+ octet = *ep++;
+ *cp++ = hex[octet >> 4];
+ *cp++ = hex[octet & 0xf];
}
*cp = '\0';
return (tp->bs_name);
u_int nsap_length)
{
u_int nsap_idx;
+ uint8_t octet;
char *cp;
struct enamemem *tp;
"isonsap_string: malloc");
for (nsap_idx = 0; nsap_idx < nsap_length; nsap_idx++) {
- *cp++ = hex[*nsap >> 4];
- *cp++ = hex[*nsap++ & 0xf];
+ octet = *nsap++;
+ *cp++ = hex[octet >> 4];
+ *cp++ = hex[octet & 0xf];
if (((nsap_idx & 1) == 0) &&
(nsap_idx + 1 < nsap_length)) {
*cp++ = '.';