]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hardlink: fix compiler warning [-Wformat=]
authorKarel Zak <kzak@redhat.com>
Fri, 26 Nov 2021 18:45:29 +0000 (19:45 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 26 Nov 2021 18:45:29 +0000 (19:45 +0100)
misc-utils/hardlink.c:726:48: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘__nlink_t’

Reported-by: Anatoly Pugachev <matorola@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/hardlink.c

index 2abd6d66442293a08e80ae179162597e58e3a1c5..2aca5ad603c3d45c2a6966493dbc4417d5f78279 100644 (file)
@@ -723,8 +723,9 @@ static int inserter(const char *fpath, const struct stat *sb,
                return 0;
        }
 
-       jlog(JLOG_VERBOSE2, " %5zu: [%ld/%ld/%ld] %s",
-                       stats.files, sb->st_dev, sb->st_ino, sb->st_nlink, fpath);
+       jlog(JLOG_VERBOSE2, " %5zu: [%ld/%ld/%zu] %s",
+                       stats.files, sb->st_dev, sb->st_ino,
+                       (size_t) sb->st_nlink, fpath);
 
        if ((opts.max_size > 0) && ((uintmax_t) sb->st_size > opts.max_size)) {
                jlog(JLOG_VERBOSE1,