From a278f72659de0950102d58890cefd81cc502e6eb Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 20 Sep 2017 17:43:07 +0200 Subject: [PATCH] skip comment lines when checking hashes [skip ci] --- demos/hashsum.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/demos/hashsum.c b/demos/hashsum.c index 9f25d0f..83ab8c6 100644 --- a/demos/hashsum.c +++ b/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;