diff options
author | Karel Zak | 2011-08-01 11:59:48 +0200 |
---|---|---|
committer | Karel Zak | 2011-08-01 12:01:24 +0200 |
commit | 6b9166ce06ed3ad0d61fda4106637603b71ea7a2 (patch) | |
tree | c042443ec9982b06bffcaf6a65053ed8225971ac /lib/sysfs.c | |
parent | lib: [at.c] fix compiler warnings [-Wunused-parameter] (diff) | |
download | kernel-qcow2-util-linux-6b9166ce06ed3ad0d61fda4106637603b71ea7a2.tar.gz kernel-qcow2-util-linux-6b9166ce06ed3ad0d61fda4106637603b71ea7a2.tar.xz kernel-qcow2-util-linux-6b9166ce06ed3ad0d61fda4106637603b71ea7a2.zip |
lib: [sysfs.c] fix compiler warnings [-Wsign-compare]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib/sysfs.c')
-rw-r--r-- | lib/sysfs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sysfs.c b/lib/sysfs.c index 7bcdabae2..eec1f243b 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -19,7 +19,7 @@ char *sysfs_devno_attribute_path(dev_t devno, char *buf, len = snprintf(buf, bufsiz, _PATH_SYS_DEVBLOCK "/%d:%d", major(devno), minor(devno)); - return (len < 0 || len + 1 > bufsiz) ? NULL : buf; + return (len < 0 || (size_t) len + 1 > bufsiz) ? NULL : buf; } int sysfs_devno_has_attribute(dev_t devno, const char *attr) @@ -62,7 +62,7 @@ dev_t sysfs_devname_to_devno(const char *name, const char *parent) */ int len = snprintf(buf, sizeof(buf), _PATH_SYS_BLOCK "/%s/%s/dev", parent, name); - if (len < 0 || len + 1 > sizeof(buf)) + if (len < 0 || (size_t) len + 1 > sizeof(buf)) return 0; path = buf; @@ -72,7 +72,7 @@ dev_t sysfs_devname_to_devno(const char *name, const char *parent) */ int len = snprintf(buf, sizeof(buf), _PATH_SYS_BLOCK "/%s/dev", name); - if (len < 0 || len + 1 > sizeof(buf)) + if (len < 0 || (size_t) len + 1 > sizeof(buf)) return 0; path = buf; } |