From: Vincenzo Frascino <[email protected]>

The use of ptrdiff_t can trigger a warning because a successive cast to
const char * can generate a pointer that cannot be dereferenced.

Replace it with intptr_t that does not require provenance since being an
integer is always valid.

Signed-off-by: Vincenzo Frascino <[email protected]>
Reviewed-by: Steve Capper <[email protected]>
Signed-off-by: Steve Capper <[email protected]>
---
 mailutils/popmaildir.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mailutils/popmaildir.c b/mailutils/popmaildir.c
index 1f2db2892..2d291cc9d 100644
--- a/mailutils/popmaildir.c
+++ b/mailutils/popmaildir.c
@@ -214,7 +214,7 @@ int popmaildir_main(int argc UNUSED_PARAM, char **argv)
                        monotonic_us(), (unsigned)pid, hostname);
 
                // retrieve message in ./tmp/ unless filter is specified
-               pop3_check(retr, (const char *)(ptrdiff_t)nmsg);
+               pop3_check(retr, (const char *)(intptr_t)nmsg);
 
 #if ENABLE_FEATURE_POPMAILDIR_DELIVERY
                // delivery helper ordered? -> setup pipe
@@ -263,7 +263,7 @@ int popmaildir_main(int argc UNUSED_PARAM, char **argv)
 
                // delete message from server
                if (!(opts & OPT_k))
-                       pop3_check("DELE %u", (const char*)(ptrdiff_t)nmsg);
+                       pop3_check("DELE %u", (const char*)(intptr_t)nmsg);
 
                // atomically move message to ./new/
                target = xstrdup(filename);
-- 
2.35.1

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to