From 31193268a6ab2ac9436adbe10832c09d7c6ffa54 Mon Sep 17 00:00:00 2001 From: Simon Nagl Date: Mon, 23 May 2016 21:06:25 +0200 Subject: [PATCH] Bugfix: Fix clang compiler build fails. --- src/main.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/main.c b/src/main.c index 2e10356e..569a15b2 100644 --- a/src/main.c +++ b/src/main.c @@ -244,6 +244,19 @@ void help(int exitcode) { exit(exitcode); } +// TODO: Remove this function with the nix major release. +void remove_option(int opt_index, int *argc, char **argv) { + int i = opt_index; + // remove the options. + do { + *argc = *argc - 1; + for(i = opt_index; i < *argc; i++) { + argv[i] = argv[i+1]; + } + i = opt_index; + } while(argv[i][0] != '-' && opt_index >= *argc); +} + int main(int argc, char **argv) { @@ -264,18 +277,6 @@ int main(int argc, char **argv) // parse depercated options // TODO: Remove this block with the next major release. { - void remove_option(int opt_index, int *argc, char **argv) { - int i = opt_index; - // remove the options. - do { - *argc = *argc - 1; - for(i = opt_index; i < *argc; i++) { - argv[i] = argv[i+1]; - } - i = opt_index; - } while(argv[i][0] != '-' && opt_index >= *argc); - } - i = 1; while(i < argc) { if(strcmp(argv[i], "-pidfile") == 0 && (i+1) < argc) { -- 2.39.2