diff options
Diffstat (limited to 'bin/md5/md5.c')
-rw-r--r-- | bin/md5/md5.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/md5/md5.c b/bin/md5/md5.c index 069b2f5..f85c690 100644 --- a/bin/md5/md5.c +++ b/bin/md5/md5.c @@ -1,4 +1,4 @@ -/* $OpenBSD: md5.c,v 1.95 2019/05/18 16:53:39 otto Exp $ */ +/* $OpenBSD: md5.c,v 1.97 2020/10/19 18:15:18 millert Exp $ */ /* * Copyright (c) 2001,2003,2005-2007,2010,2013,2014 @@ -506,7 +506,8 @@ digest_file(const char *file, struct hash_list *hl, int echo) while ((nread = fread(data, 1UL, sizeof(data), fp)) != 0) { if (echo) { (void)fwrite(data, nread, 1UL, stdout); - if (fflush(stdout) != 0) + (void)fflush(stdout); + if (ferror(stdout)) err(1, "stdout: write error"); } TAILQ_FOREACH(hf, hl, tailq) @@ -778,7 +779,7 @@ digest_time(struct hash_list *hl, int times) digest_end(hf, &context, digest, sizeof(digest), hf->base64); getrusage(RUSAGE_SELF, &stop); timersub(&stop.ru_utime, &start.ru_utime, &res); - elapsed = res.tv_sec + res.tv_usec / 1000000.0; + elapsed = (double)res.tv_sec + (double)res.tv_usec / 1000000.0; (void)printf("\nDigest = %s\n", digest); (void)printf("Time = %f seconds\n", elapsed); |