Browse Source

mcookie: fix infinite-loop when use -f

Signed-off-by: Karel Zak <kzak@redhat.com>
pull/1480/head
Hiroaki Sengoku 10 months ago committed by Karel Zak
parent
commit
60e5bb7399
  1. 2
      misc-utils/mcookie.c

2
misc-utils/mcookie.c

@ -65,7 +65,7 @@ static uint64_t hash_file(struct mcookie_control *ctl, int fd)
rdsz = wanted - count;
r = read_all(fd, (char *) buf, rdsz);
if (r < 0)
if (r <= 0)
break;
ul_MD5Update(&ctl->ctx, buf, r);
count += r;

Loading…
Cancel
Save