summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-04-02 16:53:52 -0400
committerJune McEnroe <june@causal.agency>2020-04-02 16:53:52 -0400
commit092218dea7a9c0a2ada1d50a5db1ae37fd25e21b (patch)
tree56cb1c7113ebf63dcd8c99632878bb970cae0c86
parentGenerate short option string from long options (diff)
downloadpounce-092218dea7a9c0a2ada1d50a5db1ae37fd25e21b.tar.gz
pounce-092218dea7a9c0a2ada1d50a5db1ae37fd25e21b.zip
Use for loop for getopt in calico 1.2p1
-rw-r--r--dispatch.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/dispatch.c b/dispatch.c
index c558729..1396f66 100644
--- a/dispatch.c
+++ b/dispatch.c
@@ -151,8 +151,7 @@ int main(int argc, char *argv[]) {
 	const char *path = NULL;
 	int timeout = 1000;
 
-	int opt;
-	while (0 < (opt = getopt(argc, argv, "H:P:t:"))) {
+	for (int opt; 0 < (opt = getopt(argc, argv, "H:P:t:"));) {
 		switch (opt) {
 			break; case 'H': host = optarg;
 			break; case 'P': port = optarg;