From: Eric S. Raymond Date: Fri, 12 Sep 2003 09:05:34 +0000 (+0000) Subject: Cosmetic fix. X-Git-Tag: 1.4~9 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=d83deec0af412b9e88ad89ec32e58e834a6b7d2d;p=comparator.git Cosmetic fix. --- diff --git a/main.c b/main.c index 0f5aece..9a05f96 100644 --- a/main.c +++ b/main.c @@ -247,40 +247,40 @@ static void init_scf(char *file, struct scf_t *scf) { if (file) { - char buf[BUFSIZ]; - - /* read in the SCF metadata block and add it to the in-core list */ - scf->name = strdup(file); - scf->fp = fopen(scf->name, "r"); - fgets(buf, sizeof(buf), scf->fp); - if (strncmp(buf, "#SCF-A 1.1", 9)) - { - fprintf(stderr, - "shredcompare: %s is not a SCF-A file.\n", - scf->name); - exit(1); - } - while (fgets(buf, sizeof(buf), scf->fp) != NULL) - { - char *value; + char buf[BUFSIZ]; - if (!strcmp(buf, "%%\n")) - break; - value = strchr(buf, ':'); - *value++ = '\0'; - while(*value == ' ') - value++; - strchr(value, '\n')[0] = '\0'; - - if (!strcmp(buf, "Normalization")) - scf->normalization = strdup(value); - else if (!strcmp(buf, "Shred-Size")) - scf->shred_size = atoi(value); - else if (!strcmp(buf, "Hash-Method")) - scf->hash_method = strdup(value); - else if (!strcmp(buf, "Generator-Program")) - scf->generator_program = strdup(value); - } + /* read in the SCF metadata block and add it to the in-core list */ + scf->name = strdup(file); + scf->fp = fopen(scf->name, "r"); + fgets(buf, sizeof(buf), scf->fp); + if (strncmp(buf, "#SCF-A 1.1", 9)) + { + fprintf(stderr, + "shredcompare: %s is not a SCF-A file.\n", + scf->name); + exit(1); + } + while (fgets(buf, sizeof(buf), scf->fp) != NULL) + { + char *value; + + if (!strcmp(buf, "%%\n")) + break; + value = strchr(buf, ':'); + *value++ = '\0'; + while(*value == ' ') + value++; + strchr(value, '\n')[0] = '\0'; + + if (!strcmp(buf, "Normalization")) + scf->normalization = strdup(value); + else if (!strcmp(buf, "Shred-Size")) + scf->shred_size = atoi(value); + else if (!strcmp(buf, "Hash-Method")) + scf->hash_method = strdup(value); + else if (!strcmp(buf, "Generator-Program")) + scf->generator_program = strdup(value); + } } else {