Skip to content

Commit 73c99d4

Browse files
src/lastlog.c: Use ssizeof() to avoid a -Wsign-compare diagnostic
Acked-by: Serge Hallyn <[email protected]> Signed-off-by: Alejandro Colomar <[email protected]>
1 parent 06d90b3 commit 73c99d4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lastlog.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
/*@-exitarg@*/
3131
#include "exitcodes.h"
3232
#include "shadowlog.h"
33+
#include "sizeof.h"
3334
#include "string/memset/memzero.h"
3435
#include "string/strftime.h"
3536

@@ -116,7 +117,7 @@ static void print_one (/*@null@*/const struct passwd *pw)
116117

117118

118119
offset = (off_t) pw->pw_uid * sizeof (ll);
119-
if (offset + sizeof (ll) <= statbuf.st_size) {
120+
if (offset + ssizeof(ll) <= statbuf.st_size) {
120121
/* fseeko errors are not really relevant for us. */
121122
int err = fseeko (lastlogfile, offset, SEEK_SET);
122123
assert (0 == err);

0 commit comments

Comments
 (0)