1
0
mirror of https://github.com/lammertb/libhttp.git synced 2026-01-03 16:02:30 +03:00

Fix some size warnings in the unit test

This commit is contained in:
bel
2016-05-17 23:51:25 +02:00
parent c1ecae217b
commit 74f2721412

View File

@@ -2172,10 +2172,13 @@ START_TEST(test_http_auth)
ck_assert_ptr_ne(str, NULL);
ck_assert_ptr_ne(str, auth_request + len);
/* nonce is from including (auth_request + len) to excluding (str) */
ck_assert_int_gt((int)(str) - (int)(auth_request + len), 0);
ck_assert_int_lt((int)(str) - (int)(auth_request + len), sizeof(nonce));
ck_assert_int_gt((ptrdiff_t)(str) - (ptrdiff_t)(auth_request + len), 0);
ck_assert_int_lt((ptrdiff_t)(str) - (ptrdiff_t)(auth_request + len),
(ptrdiff_t)sizeof(nonce));
memset(nonce, 0, sizeof(nonce));
memcpy(nonce, auth_request + len, (int)(str) - (int)(auth_request + len));
memcpy(nonce,
auth_request + len,
(size_t)((ptrdiff_t)(str) - (ptrdiff_t)(auth_request + len)));
memset(HA1, 0, sizeof(HA1));
memset(HA2, 0, sizeof(HA2));
memset(HA, 0, sizeof(HA));