summaryrefslogtreecommitdiffstats
path: root/src/libsystemd/sd-hwdb/sd-hwdb.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-03-04 15:42:58 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-03-04 15:42:58 +0100
commit756479043de59fdad988598f20d06e78b7da75ab (patch)
treec799f86951d2136f8774ae8c64f90d756ca27251 /src/libsystemd/sd-hwdb/sd-hwdb.c
parentRemove now-unused refcnt.h (diff)
downloadsystemd-756479043de59fdad988598f20d06e78b7da75ab.tar.xz
systemd-756479043de59fdad988598f20d06e78b7da75ab.zip
sd-hwdb: fix off_t vs. size_t confusion in cast
> on 32bit, size_t is 32bit, but .st_size is off_t hence 64bit
Diffstat (limited to 'src/libsystemd/sd-hwdb/sd-hwdb.c')
-rw-r--r--src/libsystemd/sd-hwdb/sd-hwdb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd/sd-hwdb/sd-hwdb.c b/src/libsystemd/sd-hwdb/sd-hwdb.c
index 64aaf01454..d8c37c3fd4 100644
--- a/src/libsystemd/sd-hwdb/sd-hwdb.c
+++ b/src/libsystemd/sd-hwdb/sd-hwdb.c
@@ -333,7 +333,7 @@ _public_ int sd_hwdb_new(sd_hwdb **ret) {
if (fstat(fileno(hwdb->f), &hwdb->st) < 0)
return log_debug_errno(errno, "Failed to stat %s: %m", hwdb_bin_path);
- if ((size_t) hwdb->st.st_size < offsetof(struct trie_header_f, strings_len) + 8)
+ if (hwdb->st.st_size < (off_t) offsetof(struct trie_header_f, strings_len) + 8)
return log_debug_errno(SYNTHETIC_ERRNO(EIO),
"File %s is too short: %m", hwdb_bin_path);