Use parens around the sizeof argument, to match the style used elsewhere.
};
static const char *auth_alg_text[]={"Open System","Shared Key","EAP"};
-#define NUM_AUTH_ALGS (sizeof auth_alg_text / sizeof auth_alg_text[0])
+#define NUM_AUTH_ALGS (sizeof(auth_alg_text) / sizeof(auth_alg_text[0]))
static const char *status_text[] = {
"Successful", /* 0 */
"The Destination STA is not a QSTA.", /* 50 */
};
-#define NUM_STATUSES (sizeof status_text / sizeof status_text[0])
+#define NUM_STATUSES (sizeof(status_text) / sizeof(status_text[0]))
static const char *reason_text[] = {
"Reserved", /* 0 */
"Association denied due to requesting STA not supporting HT "
"features", /* 46 */
};
-#define NUM_REASONS (sizeof reason_text / sizeof reason_text[0])
+#define NUM_REASONS (sizeof(reason_text) / sizeof(reason_text[0]))
static int
wep_print(netdissect_options *ndo,
offset += 2;
length -= 2;
if (rates.length != 0) {
- if (rates.length > sizeof rates.rate)
+ if (rates.length > sizeof(rates.rate))
return 0;
memcpy(&rates.rate, p + offset, rates.length);
offset += rates.length;
length -= tim.length;
break;
}
- if (tim.length - 3U > sizeof tim.bitmap)
+ if (tim.length - 3U > sizeof(tim.bitmap))
return 0;
memcpy(&tim.count, p + offset, 3);
offset += 3;
ND_TCHECK_1(bp->bp_sname); /* check first char only */
if (EXTRACT_U_1(bp->bp_sname)) {
ND_PRINT("\n\t sname \"");
- if (fn_printztn(ndo, bp->bp_sname, (u_int)sizeof bp->bp_sname,
+ if (fn_printztn(ndo, bp->bp_sname, (u_int)sizeof(bp->bp_sname),
ndo->ndo_snapend)) {
ND_PRINT("\"");
ND_PRINT("%s", tstr + 1);
ND_TCHECK_1(bp->bp_file); /* check first char only */
if (EXTRACT_U_1(bp->bp_file)) {
ND_PRINT("\n\t file \"");
- if (fn_printztn(ndo, bp->bp_file, (u_int)sizeof bp->bp_file,
+ if (fn_printztn(ndo, bp->bp_file, (u_int)sizeof(bp->bp_file),
ndo->ndo_snapend)) {
ND_PRINT("\"");
ND_PRINT("%s", tstr + 1);
if (!ND_TTEST_LEN(tptr, byte_length))
return (0);
- memset(prefix, 0, sizeof prefix); /* clear the copy buffer */
+ memset(prefix, 0, sizeof(prefix)); /* clear the copy buffer */
memcpy(prefix,tptr,byte_length); /* copy as much as is stored in the TLV */
tptr+=byte_length;
processed+=byte_length;
"PPP-Muxing", /* (30) */
};
-#define NUM_LCPOPTS (sizeof lcpconfopts / sizeof lcpconfopts[0])
+#define NUM_LCPOPTS (sizeof(lcpconfopts) / sizeof(lcpconfopts[0]))
/* ECP - to be supported */
if (sport > dport)
rev = 1;
else if (sport == dport) {
- if (UNALIGNED_MEMCMP(src, dst, sizeof ip6->ip6_dst) > 0)
+ if (UNALIGNED_MEMCMP(src, dst, sizeof(ip6->ip6_dst)) > 0)
rev = 1;
}
if (rev) {
- UNALIGNED_MEMCPY(&tha.src, dst, sizeof ip6->ip6_dst);
- UNALIGNED_MEMCPY(&tha.dst, src, sizeof ip6->ip6_src);
+ UNALIGNED_MEMCPY(&tha.src, dst, sizeof(ip6->ip6_dst));
+ UNALIGNED_MEMCPY(&tha.dst, src, sizeof(ip6->ip6_src));
tha.port = dport << 16 | sport;
} else {
- UNALIGNED_MEMCPY(&tha.dst, dst, sizeof ip6->ip6_dst);
- UNALIGNED_MEMCPY(&tha.src, src, sizeof ip6->ip6_src);
+ UNALIGNED_MEMCPY(&tha.dst, dst, sizeof(ip6->ip6_dst));
+ UNALIGNED_MEMCPY(&tha.src, src, sizeof(ip6->ip6_src));
tha.port = sport << 16 | dport;
}
if (sport > dport)
rev = 1;
else if (sport == dport) {
- if (UNALIGNED_MEMCMP(ip->ip_src, ip->ip_dst, sizeof ip->ip_dst) > 0)
+ if (UNALIGNED_MEMCMP(ip->ip_src, ip->ip_dst, sizeof(ip->ip_dst)) > 0)
rev = 1;
}
if (rev) {
UNALIGNED_MEMCPY(&tha.src, ip->ip_dst,
- sizeof ip->ip_dst);
+ sizeof(ip->ip_dst));
UNALIGNED_MEMCPY(&tha.dst, ip->ip_src,
- sizeof ip->ip_src);
+ sizeof(ip->ip_src));
tha.port = dport << 16 | sport;
} else {
UNALIGNED_MEMCPY(&tha.dst, ip->ip_dst,
- sizeof ip->ip_dst);
+ sizeof(ip->ip_dst));
UNALIGNED_MEMCPY(&tha.src, ip->ip_src,
- sizeof ip->ip_src);
+ sizeof(ip->ip_src));
tha.port = sport << 16 | dport;
}
*/
/* start out by storing key in pads */
- memset(k_ipad, 0, sizeof k_ipad);
- memset(k_opad, 0, sizeof k_opad);
+ memset(k_ipad, 0, sizeof(k_ipad));
+ memset(k_opad, 0, sizeof(k_opad));
memcpy(k_ipad, key, key_len);
memcpy(k_opad, key, key_len);
/*
* Initialize the netdissect code.
*/
- if (nd_init(ebuf, sizeof ebuf) == -1)
+ if (nd_init(ebuf, sizeof(ebuf)) == -1)
error("%s", ebuf);
memset(ndo, 0, sizeof(*ndo));
case 'm':
if (nd_have_smi_support()) {
- if (nd_load_smi_module(optarg, ebuf, sizeof ebuf) == -1)
+ if (nd_load_smi_module(optarg, ebuf, sizeof(ebuf)) == -1)
error("%s", ebuf);
} else {
(void)fprintf(stderr, "%s: ignoring option `-m %s' ",