From da7d4ed898d8fcb69362c03c01201807c4f4823d Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sun, 9 Feb 2025 12:45:11 +0100 Subject: [PATCH] src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic Acked-by: Serge Hallyn Signed-off-by: Alejandro Colomar --- src/lastlog.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lastlog.c b/src/lastlog.c index d622ba84e..1a5e1a631 100644 --- a/src/lastlog.c +++ b/src/lastlog.c @@ -30,6 +30,7 @@ /*@-exitarg@*/ #include "exitcodes.h" #include "shadowlog.h" +#include "sizeof.h" #include "string/memset/memzero.h" #include "string/strftime.h" @@ -116,7 +117,7 @@ static void print_one (/*@null@*/const struct passwd *pw) offset = (off_t) pw->pw_uid * sizeof (ll); - if (offset + sizeof (ll) <= statbuf.st_size) { + if (offset + ssizeof(ll) <= statbuf.st_size) { /* fseeko errors are not really relevant for us. */ int err = fseeko (lastlogfile, offset, SEEK_SET); assert (0 == err); -- 2.47.2