From 998ee88aa50adb77777d9122a5048255a7ab7327 Mon Sep 17 00:00:00 2001 From: Karol Babioch Date: Mon, 9 Apr 2018 17:14:18 +0200 Subject: [PATCH] tests: Fix compiler warnings due to wrong pointer casts This fixes a couple of compiler warnings due to wrong pointer casts in regards to the pamh structure, which is a bit of a hackery way to access the test data. --- tests/pam_test.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/pam_test.c b/tests/pam_test.c index 197d179..fbeb0f4 100644 --- a/tests/pam_test.c +++ b/tests/pam_test.c @@ -28,6 +28,7 @@ */ #include +#include #include #include @@ -146,13 +147,13 @@ static struct pam_conv pam_conversation = { }; int pam_get_item(const pam_handle_t *pamh, int item_type, const void **item) { - fprintf(stderr, "in pam_get_item() %d for %d\n", item_type, (int)pamh); + fprintf(stderr, "in pam_get_item() %d for %d\n", item_type, (int)(uintptr_t)pamh); if(item_type == PAM_CONV) { pam_conversation.appdata_ptr = (void*)pamh; *item = &pam_conversation; } - if(item_type == PAM_AUTHTOK && pamh >= 8) { - *item = (void*)_data[(int)pamh].otp; + if(item_type == PAM_AUTHTOK && pamh >= (pam_handle_t*)8) { + *item = (void*)_data[(int)(uintptr_t)pamh].otp; } return PAM_SUCCESS; }