summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coreutils/md5_sha1_sum.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/coreutils/md5_sha1_sum.c b/coreutils/md5_sha1_sum.c
index 3b389cb..0e57673 100644
--- a/coreutils/md5_sha1_sum.c
+++ b/coreutils/md5_sha1_sum.c
@@ -300,12 +300,10 @@ int md5_sha1_sum_main(int argc UNUSED_PARAM, char **argv)
char *filename_ptr;
count_total++;
- filename_ptr = strstr(line, " ");
- /* handle format for binary checksums */
- if (filename_ptr == NULL) {
- filename_ptr = strstr(line, " *");
- }
- if (filename_ptr == NULL) {
+ filename_ptr = strchr(line, ' ');
+ if (filename_ptr == NULL
+ || (filename_ptr[1] != ' ' && filename_ptr[1] != '*')
+ ) {
if (flags & FLAG_WARN) {
bb_simple_error_msg("invalid format");
}