]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
authorAlejandro Colomar <alx@kernel.org>
Sun, 9 Feb 2025 11:45:11 +0000 (12:45 +0100)
committerAlejandro Colomar <alx@kernel.org>
Mon, 3 Mar 2025 23:08:15 +0000 (00:08 +0100)
Acked-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/lastlog.c

index d622ba84e7453ecf006db43be768a21239ffe805..1a5e1a631c648e1cfd5ce77d77d1a1e5cb96da9b 100644 (file)
@@ -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);