catpoint

simple slides viewer
git clone git://git.2f30.org/catpoint
Log | Files | Refs | README | LICENSE

commit 9c863cd38ad1d01c2d745fe3c63e7e86f08d4c40
parent 521aeb3a745c85def34f6e525c52327267aec23f
Author: Lazaros Koromilas <lostd@2f30.org>
Date:   Sat,  9 Feb 2019 20:13:32 +0200

Revert "Be more explicit with the for-loop-arguments"

This reverts commit 1d3e7aa314aa826b56fb4dd5855bd892696f03f7.

Diffstat:
Mcatpoint.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/catpoint.c b/catpoint.c @@ -32,7 +32,7 @@ main(int argc, char *argv[]) err(1, "malloc"); /* map files to mem */ - for (i = 0; i < argc; i++) { + for (i = 0; argv[i] != NULL; i++) { fd = open(argv[i], O_RDONLY); if (fd == -1) err(1, "open: %s", argv[i]); @@ -88,7 +88,7 @@ again: } /* unmap mem */ - for (i = 0; i < argc; ++i) + for (i = 0; argv[i] != NULL; i++) munmap(s[i].buf, s[i].siz); free(s);