summaryrefslogtreecommitdiff
path: root/v5/apf_interpreter.c
diff options
context:
space:
mode:
Diffstat (limited to 'v5/apf_interpreter.c')
-rw-r--r--v5/apf_interpreter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/v5/apf_interpreter.c b/v5/apf_interpreter.c
index 16fce48..3bca784 100644
--- a/v5/apf_interpreter.c
+++ b/v5/apf_interpreter.c
@@ -405,7 +405,7 @@ FUNC(match_result_type apf_internal_match_single_name(const u8* needle,
if (*ofs >= udp_len) return error_packet;
u8 w = udp[(*ofs)++];
if (*ofs > first_unread_offset) first_unread_offset = *ofs;
- u32 new_ofs = (v - 0xC0) * 256 + w;
+ u32 new_ofs = (v - 0xC0) * 256u + w;
if (new_ofs >= *ofs) return error_packet; /* RFC 1035 4.1.4 allows only backward pointers */
*ofs = new_ofs;
} else if (v > 63) {
@@ -507,7 +507,7 @@ FUNC(match_result_type apf_internal_match_names(const u8* needles,
*/
FUNC(u16 apf_internal_calc_csum(u32 sum, const u8* const buf, const s32 len)) {
s32 i;
- for (i = 0; i < len; ++i) sum += buf[i] * ((i & 1) ? 1 : 256);
+ for (i = 0; i < len; ++i) sum += buf[i] * ((i & 1) ? 1u : 256u);
sum = (sum & 0xFFFF) + (sum >> 16); /* max after this is 1FFFE */
u16 csum = sum + (sum >> 16);