- {
- static const char bin2hex[] = { '0', '1', '2', '3',
- '4', '5', '6', '7',
- '8', '9', 'a', 'b',
- 'c', 'd', 'e', 'f' };
- bool ok;
-
- ++n_properly_formatted_lines;
-
- ok = digest_file (filename, &binary, bin_buffer);
-
- if (!ok)
- {
- ++n_open_or_read_failures;
- if (!status_only)
- {
- printf (_("%s: FAILED open or read\n"), filename);
- fflush (stdout);
- }
- }
- else
- {
- size_t digest_bin_bytes = digest_hex_bytes / 2;
- size_t cnt;
- /* Compare generated binary number with text representation
- in check file. Ignore case of hex digits. */
- for (cnt = 0; cnt < digest_bin_bytes; ++cnt)
- {
- if (TOLOWER (hex_digest[2 * cnt])
- != bin2hex[bin_buffer[cnt] >> 4]
- || (TOLOWER (hex_digest[2 * cnt + 1])
- != (bin2hex[bin_buffer[cnt] & 0xf])))
- break;
- }
- if (cnt != digest_bin_bytes)
- ++n_mismatched_checksums;
-
- if (!status_only)
- {
- printf ("%s: %s\n", filename,
- (cnt != digest_bin_bytes ? _("FAILED") : _("OK")));
- fflush (stdout);
- }
- }
- }
+ {
+ static const char bin2hex[] = { '0', '1', '2', '3',
+ '4', '5', '6', '7',
+ '8', '9', 'a', 'b',
+ 'c', 'd', 'e', 'f' };
+ bool ok;
+
+ ++n_properly_formatted_lines;
+
+ ok = digest_file (filename, &binary, bin_buffer);
+
+ if (!ok)
+ {
+ ++n_open_or_read_failures;
+ if (!status_only)
+ {
+ printf (_("%s: FAILED open or read\n"), filename);
+ }
+ }
+ else
+ {
+ size_t digest_bin_bytes = digest_hex_bytes / 2;
+ size_t cnt;
+ /* Compare generated binary number with text representation
+ in check file. Ignore case of hex digits. */
+ for (cnt = 0; cnt < digest_bin_bytes; ++cnt)
+ {
+ if (tolower (hex_digest[2 * cnt])
+ != bin2hex[bin_buffer[cnt] >> 4]
+ || (tolower (hex_digest[2 * cnt + 1])
+ != (bin2hex[bin_buffer[cnt] & 0xf])))
+ break;
+ }
+ if (cnt != digest_bin_bytes)
+ ++n_mismatched_checksums;
+
+ if (!status_only)
+ {
+ if (cnt != digest_bin_bytes)
+ printf ("%s: %s\n", filename, _("FAILED"));
+ else if (!quiet)
+ printf ("%s: %s\n", filename, _("OK"));
+ }
+ }
+ }