From 7ba9f13b1bf11521ff0afa5edf9070361fbed5e7 Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Mon, 21 Apr 2025 10:42:42 +0100 Subject: [PATCH] Use a index loop instead so the loop can end --- lib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib.c b/lib.c index fcb1971..c6c0717 100644 --- a/lib.c +++ b/lib.c @@ -80,7 +80,7 @@ static void print_usage (void) { if (program_name) { - struct options_with_use *options_with_use; + int emul_count = sizeof (emulation_table) / sizeof (emulation_table[0]), i; fprintf (stderr, "Usage: %s [options] file...\n\n", program_name); fprintf (stderr, "Options:\n\n"); @@ -113,11 +113,11 @@ static void print_usage (void) { fprintf (stderr, "\n"); - for (options_with_use = emulation_table; ; options_with_use++) { + for (i = 0; i < emul_count; i++) { - if (options_with_use->print_help) { + if (emulation_table[i].print_help) { - options_with_use->print_help (); + emulation_table[i].print_help (); fprintf (stderr, "\n"); } -- 2.34.1