Explorar o código

skip comment lines when checking hashes

[skip ci]
Steffen Jaeckel %!s(int64=8) %!d(string=hai) anos
pai
achega
a278f72659
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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;