Browse Source

skip comment lines when checking hashes

[skip ci]
Steffen Jaeckel 8 years ago
parent
commit
a278f72659
1 changed files with 4 additions and 0 deletions
  1. 4 0
      demos/hashsum.c

+ 4 - 0
demos/hashsum.c

@@ -90,6 +90,10 @@ static void check_file(int argn, int argc, char **argv)
          int tries, n;
          unsigned long hash_len, w, x;
          char* space = strstr(s, " ");
+
+         /* skip lines with comments */
+         if (buf[0] == '#') continue;
+
          if (space == NULL) {
             fprintf(stderr, "%s: no properly formatted checksum lines found\n", hashsum);
             goto ERR;