From: Alejandro Colomar Date: Sun, 9 Feb 2025 11:45:11 +0000 (+0100) Subject: src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic X-Git-Tag: 4.17.4~2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=da7d4ed898d8fcb69362c03c01201807c4f4823d;p=thirdparty%2Fshadow.git src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic Acked-by: Serge Hallyn Signed-off-by: Alejandro Colomar --- 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);