aboutsummaryrefslogtreecommitdiff
path: root/md5sum.c
diff options
context:
space:
mode:
Diffstat (limited to 'md5sum.c')
-rw-r--r--md5sum.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/md5sum.c b/md5sum.c
index ad4078040..97a940059 100644
--- a/md5sum.c
+++ b/md5sum.c
@@ -719,7 +719,7 @@ static int md5_check(const char *checkfile_name)
719 if (split_3(line, line_length, &md5num, &binary, &filename) 719 if (split_3(line, line_length, &md5num, &binary, &filename)
720 || !hex_digits(md5num)) { 720 || !hex_digits(md5num)) {
721 if (warn) { 721 if (warn) {
722 error_msg("%s: %lu: improperly formatted MD5 checksum line\n", 722 error_msg("%s: %lu: improperly formatted MD5 checksum line",
723 checkfile_name, (unsigned long) line_number); 723 checkfile_name, (unsigned long) line_number);
724 } 724 }
725 } else { 725 } else {
@@ -764,7 +764,7 @@ static int md5_check(const char *checkfile_name)
764 while (!feof(checkfile_stream) && !ferror(checkfile_stream)); 764 while (!feof(checkfile_stream) && !ferror(checkfile_stream));
765 765
766 if (ferror(checkfile_stream)) { 766 if (ferror(checkfile_stream)) {
767 error_msg("%s: read error\n", checkfile_name); /* */ 767 error_msg("%s: read error", checkfile_name);
768 return FALSE; 768 return FALSE;
769 } 769 }
770 770
@@ -775,7 +775,7 @@ static int md5_check(const char *checkfile_name)
775 775
776 if (n_properly_formated_lines == 0) { 776 if (n_properly_formated_lines == 0) {
777 /* Warn if no tests are found. */ 777 /* Warn if no tests are found. */
778 error_msg("%s: no properly formatted MD5 checksum lines found\n", 778 error_msg("%s: no properly formatted MD5 checksum lines found",
779 checkfile_name); 779 checkfile_name);
780 return FALSE; 780 return FALSE;
781 } else { 781 } else {
@@ -784,13 +784,13 @@ static int md5_check(const char *checkfile_name)
784 - n_open_or_read_failures); 784 - n_open_or_read_failures);
785 785
786 if (n_open_or_read_failures > 0) { 786 if (n_open_or_read_failures > 0) {
787 error_msg("WARNING: %d of %d listed files could not be read\n", 787 error_msg("WARNING: %d of %d listed files could not be read",
788 n_open_or_read_failures, n_properly_formated_lines); 788 n_open_or_read_failures, n_properly_formated_lines);
789 return FALSE; 789 return FALSE;
790 } 790 }
791 791
792 if (n_mismatched_checksums > 0) { 792 if (n_mismatched_checksums > 0) {
793 error_msg("WARNING: %d of %d computed checksums did NOT match\n", 793 error_msg("WARNING: %d of %d computed checksums did NOT match",
794 n_mismatched_checksums, n_computed_checkums); 794 n_mismatched_checksums, n_computed_checkums);
795 return FALSE; 795 return FALSE;
796 } 796 }
@@ -855,26 +855,26 @@ int md5sum_main(int argc,
855 } 855 }
856 856
857 if (file_type_specified && do_check) { 857 if (file_type_specified && do_check) {
858 error_msg_and_die("the -b and -t options are meaningless when verifying checksums\n"); 858 error_msg_and_die("the -b and -t options are meaningless when verifying checksums");
859 } 859 }
860 860
861 if (n_strings > 0 && do_check) { 861 if (n_strings > 0 && do_check) {
862 error_msg_and_die("the -g and -c options are mutually exclusive\n"); 862 error_msg_and_die("the -g and -c options are mutually exclusive");
863 } 863 }
864 864
865 if (status_only && !do_check) { 865 if (status_only && !do_check) {
866 error_msg_and_die("the -s option is meaningful only when verifying checksums\n"); 866 error_msg_and_die("the -s option is meaningful only when verifying checksums");
867 } 867 }
868 868
869 if (warn && !do_check) { 869 if (warn && !do_check) {
870 error_msg_and_die("the -w option is meaningful only when verifying checksums\n"); 870 error_msg_and_die("the -w option is meaningful only when verifying checksums");
871 } 871 }
872 872
873 if (n_strings > 0) { 873 if (n_strings > 0) {
874 size_t i; 874 size_t i;
875 875
876 if (optind < argc) { 876 if (optind < argc) {
877 error_msg_and_die("no files may be specified when using -g\n"); 877 error_msg_and_die("no files may be specified when using -g");
878 } 878 }
879 for (i = 0; i < n_strings; ++i) { 879 for (i = 0; i < n_strings; ++i) {
880 size_t cnt; 880 size_t cnt;
@@ -887,7 +887,7 @@ int md5sum_main(int argc,
887 } 887 }
888 } else if (do_check) { 888 } else if (do_check) {
889 if (optind + 1 < argc) { 889 if (optind + 1 < argc) {
890 error_msg("only one argument may be specified when using -c\n"); 890 error_msg("only one argument may be specified when using -c");
891 } 891 }
892 892
893 err = md5_check ((optind == argc) ? "-" : argv[optind]); 893 err = md5_check ((optind == argc) ? "-" : argv[optind]);
@@ -940,11 +940,11 @@ int md5sum_main(int argc,
940 } 940 }
941 941
942 if (fclose (stdout) == EOF) { 942 if (fclose (stdout) == EOF) {
943 error_msg_and_die("write error\n"); 943 error_msg_and_die("write error");
944 } 944 }
945 945
946 if (have_read_stdin && fclose (stdin) == EOF) { 946 if (have_read_stdin && fclose (stdin) == EOF) {
947 error_msg_and_die("standard input\n"); 947 error_msg_and_die("standard input");
948 } 948 }
949 949
950 if (err == 0) 950 if (err == 0)