aboutsummaryrefslogtreecommitdiffstats
path: root/src/md5sum.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/md5sum.c')
-rw-r--r--src/md5sum.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/md5sum.c b/src/md5sum.c
index c8e01efb8..aa2a144a7 100644
--- a/src/md5sum.c
+++ b/src/md5sum.c
@@ -195,7 +195,7 @@ should be a former output of this program. The default mode is to print\n\
a line with checksum, a character indicating type (`*' for binary, ` ' for\n\
text), and name for each FILE.\n"),
DIGEST_REFERENCE);
- emit_bug_reporting_address ();
+ emit_ancillary_info ();
}
exit (status);
@@ -251,11 +251,10 @@ static bool
split_3 (char *s, size_t s_len,
unsigned char **hex_digest, int *binary, char **file_name)
{
- size_t i;
bool escaped_filename = false;
size_t algo_name_len;
- i = 0;
+ size_t i = 0;
while (ISWHITE (s[i]))
++i;
@@ -263,11 +262,13 @@ split_3 (char *s, size_t s_len,
algo_name_len = strlen (DIGEST_TYPE_STRING);
if (strncmp (s + i, DIGEST_TYPE_STRING, algo_name_len) == 0)
{
- if (strncmp (s + i + algo_name_len, " (", 2) == 0)
+ if (s[i + algo_name_len] == ' ')
+ ++i;
+ if (s[i + algo_name_len] == '(')
{
*binary = 0;
- return bsd_split_3 (s + i + algo_name_len + 2,
- s_len - (i + algo_name_len + 2),
+ return bsd_split_3 (s + i + algo_name_len + 1,
+ s_len - (i + algo_name_len + 1),
hex_digest, file_name);
}
}
@@ -661,21 +662,21 @@ main (int argc, char **argv)
usage (EXIT_FAILURE);
}
- if (status_only & !do_check)
+ if (status_only && !do_check)
{
error (0, 0,
_("the --status option is meaningful only when verifying checksums"));
usage (EXIT_FAILURE);
}
- if (warn & !do_check)
+ if (warn && !do_check)
{
error (0, 0,
_("the --warn option is meaningful only when verifying checksums"));
usage (EXIT_FAILURE);
}
- if (quiet & !do_check)
+ if (quiet && !do_check)
{
error (0, 0,
_("the --quiet option is meaningful only when verifying checksums"));