aboutsummaryrefslogtreecommitdiff
path: root/pgm-interlace.c
diff options
context:
space:
mode:
authorDavid Phillips <dbphillipsnz@gmail.com>2016-04-22 21:29:12 +1200
committerDavid Phillips <dbphillipsnz@gmail.com>2016-04-22 21:29:12 +1200
commit2cabe1cf03f1e489144dc5018125336a757c8727 (patch)
tree4aa1e4da3610555f4b2f115fd8949ae3de5f387f /pgm-interlace.c
parent932682b102222ae8f490b42c058fe7c186380e44 (diff)
downloadpgm-interlace-2cabe1cf03f1e489144dc5018125336a757c8727.tar.xz
Comment and whitespace fixes
Diffstat (limited to 'pgm-interlace.c')
-rw-r--r--pgm-interlace.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/pgm-interlace.c b/pgm-interlace.c
index 4e500da..c9b0db1 100644
--- a/pgm-interlace.c
+++ b/pgm-interlace.c
@@ -168,7 +168,6 @@ int main(int argc, char **argv)
return 1;
}
-
for (i = 1; i < argc; i++)
{
if ((f[i-1] = fopen(argv[i], "r")) == NULL)
@@ -183,13 +182,14 @@ int main(int argc, char **argv)
}
}
-
+ /* read the first file's header and check that the values are sane */
if (parse_header(f[0], magic, &width, &size, &white) != 0)
return 1;
if (check_sanity(width, size, white, clust_total) != 0)
return 1;
+ /* check that header values all agree */
for (i = 1; i < clust_total; i++)
{
parse_header(f[i], new_magic, &new_width, &new_size, &new_white);
@@ -203,7 +203,6 @@ int main(int argc, char **argv)
}
}
- /* check that header values all agree */
fprintf(stderr, "Full image size will be %ldx%ld, using %d images\n", size, size, clust_total);
/* Output PGM Header */
@@ -215,7 +214,7 @@ int main(int argc, char **argv)
for (x = 0; x < size; x++)
putchar(fgetc(f[x%clust_total]));
-
+ /* close all input files */
for (i = 1; i < argc; i++)
fclose(f[i-1]);