diff options
Diffstat (limited to 'ares_query.c')
-rw-r--r-- | ares_query.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ares_query.c b/ares_query.c index c7c31ed..3959c0e 100644 --- a/ares_query.c +++ b/ares_query.c @@ -53,13 +53,13 @@ void ares__rc4(rc4_key* key, unsigned char *buffer_ptr, int buffer_len) state = &key->state[0]; for(counter = 0; counter < buffer_len; counter ++) { - x = (x + 1) % 256; - y = (state[x] + y) % 256; - ARES_SWAP_BYTE(&state[x], &state[y]); + x = (unsigned char)((x + 1) % 256); + y = (unsigned char)((state[x] + y) % 256); + ARES_SWAP_BYTE(&state[x], &state[y]); - xorIndex = (state[x] + state[y]) % 256; + xorIndex = (unsigned char)((state[x] + state[y]) % 256); - buffer_ptr[counter] ^= state[xorIndex]; + buffer_ptr[counter] = (unsigned char)(buffer_ptr[counter]^state[xorIndex]); } key->x = x; key->y = y; |