26 lines
820 B
Diff
26 lines
820 B
Diff
From 1cbbe5e6e0cc3f7fb26055e952153c3a23bfad45 Mon Sep 17 00:00:00 2001
|
|
From: Artem Senichev <artemsen@gmail.com>
|
|
Date: Sat, 17 Sep 2022 11:57:10 +0300
|
|
Subject: [PATCH] Allow long option `--help`
|
|
|
|
Fix error when `--help` is not accepted by getopt.
|
|
|
|
Signed-off-by: Artem Senichev <artemsen@gmail.com>
|
|
---
|
|
src/main.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/src/main.c b/src/main.c
|
|
index 3939ccb..4eecd12 100644
|
|
--- a/src/main.c
|
|
+++ b/src/main.c
|
|
@@ -93,7 +93,7 @@ static int parse_cmdargs(int argc, char* argv[], struct config* cfg)
|
|
}
|
|
// add terminations
|
|
*short_opts_ptr = 0;
|
|
- memset(&options[(sizeof(arguments) / sizeof(arguments[0])) - 1], 0,
|
|
+ memset(&options[(sizeof(arguments) / sizeof(arguments[0]))], 0,
|
|
sizeof(struct option));
|
|
|
|
// parse arguments
|