summaryrefslogtreecommitdiffstats
path: root/misc-utils
diff options
context:
space:
mode:
authorKarel Zak2019-05-02 12:48:05 +0200
committerKarel Zak2019-05-02 12:48:05 +0200
commit74a4d22078a588097f78deaa18b3909393d15e08 (patch)
tree23a1932fe076200549f79c1388e43a15735d109d /misc-utils
parenthardlink: retire NIOBUF in favour of more common BUFSIZ (diff)
downloadkernel-qcow2-util-linux-74a4d22078a588097f78deaa18b3909393d15e08.tar.gz
kernel-qcow2-util-linux-74a4d22078a588097f78deaa18b3909393d15e08.tar.xz
kernel-qcow2-util-linux-74a4d22078a588097f78deaa18b3909393d15e08.zip
hardlink: fix compiler warnings [-Wsign-compare -Wmaybe-uninitialized]]
misc-utils/hardlink.c: In function ‘process_path’: misc-utils/hardlink.c:287:30: warning: operand of ?: changes signedness from ‘off_t’ {aka ‘long int’} to ‘long unsigned int’ due to unsignedness of other operand [-Wsign-compare] misc-utils/hardlink.c: In function ‘main’: misc-utils/hardlink.c:455:5: warning: ‘exclude_pattern’ may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils')
-rw-r--r--misc-utils/hardlink.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/misc-utils/hardlink.c b/misc-utils/hardlink.c
index 3354273cb..4acd8d7e6 100644
--- a/misc-utils/hardlink.c
+++ b/misc-utils/hardlink.c
@@ -283,8 +283,8 @@ static void process_path(struct hardlink_ctl *ctl, const char *name)
for (fsize = st.st_size; fsize > 0;
fsize -= (off_t)sizeof(ctl->iobuf1)) {
ssize_t xsz;
- ssize_t rsize = fsize > (ssize_t)sizeof(ctl->iobuf1) ?
- sizeof(ctl->iobuf1) : fsize;
+ ssize_t rsize = fsize > (ssize_t) sizeof(ctl->iobuf1) ?
+ (ssize_t) sizeof(ctl->iobuf1) : fsize;
if ((xsz = read(fd, ctl->iobuf1, rsize)) != rsize)
warn(_("cannot read %s"), name);
@@ -393,7 +393,7 @@ int main(int argc, char **argv)
int errornumber;
PCRE2_SIZE erroroffset;
pcre2_code *re;
- PCRE2_SPTR exclude_pattern;
+ PCRE2_SPTR exclude_pattern = NULL;
pcre2_match_data *match_data;
#endif
struct hardlink_dynstr nam1 = { NULL, 0 };