From d156d07f44536bca14c847f7f5313c956a625f96 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Thu, 2 Apr 2020 16:29:36 -0400 Subject: Update style Replacing declarations followed by while loops with for loops and generating the short option string from the long options. --- unscoop.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'unscoop.c') diff --git a/unscoop.c b/unscoop.c index afc42b5..6e7b362 100644 --- a/unscoop.c +++ b/unscoop.c @@ -305,8 +305,7 @@ int main(int argc, char *argv[]) { const char *context = NULL; const struct Format *format = &Formats[0]; - int opt; - while (0 < (opt = getopt(argc, argv, "DN:c:d:f:v"))) { + for (int opt; 0 < (opt = getopt(argc, argv, "DN:c:d:f:v"));) { switch (opt) { break; case 'D': dedup = true; break; case 'N': network = optarg; @@ -391,8 +390,7 @@ int main(int argc, char *argv[]) { } dbRun(insertContext); - ssize_t len; - while (0 < (len = getline(&line, &cap, file))) { + for (ssize_t len; 0 < (len = getline(&line, &cap, file));) { matchLine(format, regex, line); sizeRead += len; if (100 * sizeRead / sizeTotal != sizePercent) { -- cgit 1.4.1