diff --git a/src/log_proxy_wrapper.c b/src/log_proxy_wrapper.c index bc34a79..396a04a 100644 --- a/src/log_proxy_wrapper.c +++ b/src/log_proxy_wrapper.c @@ -24,7 +24,7 @@ GOptionEntry *change_options() int number_of_options = sizeof(entries) / sizeof(entries[0]); // we remove 2 options and we add 3 new GOptionEntry *res = g_malloc(sizeof(GOptionEntry) * (number_of_options + 1)); - for (int i = 0 ; i < number_of_options ; i++) { + for (int i = 0 ; i < number_of_options - 1; i++) { if (g_strcmp0(entries[i].long_name, "fifo") == 0) { continue; } @@ -33,9 +33,10 @@ GOptionEntry *change_options() } res[i] = entries[i]; } - res[number_of_options - 2] = new_entry1; - res[number_of_options - 1] = new_entry2; - res[number_of_options] = new_entry3; + res[number_of_options - 3] = new_entry1; + res[number_of_options - 2] = new_entry2; + res[number_of_options - 1] = new_entry3; + res[number_of_options] = entries[number_of_options - 1]; return res; } diff --git a/src/options.h b/src/options.h index 7201014..a954b38 100644 --- a/src/options.h +++ b/src/options.h @@ -92,7 +92,8 @@ static GOptionEntry entries[] = { { "chgrp", 'g', 0, G_OPTION_ARG_STRING, &chgrp_str, "if set, try (if you don't have sufficient privileges, it will fail silently) to change the group of the logfile to the given group value", NULL }, { "use-locks", 'm', 0, G_OPTION_ARG_NONE, &use_locks, "use locks to append to main log file (useful if several process writes to the same file)", NULL }, { "fifo", 'f', 0, G_OPTION_ARG_STRING, &fifo, "if set, read lines on this fifo instead of stdin", NULL }, - { "rm-fifo-at-exit", 'r', 0, G_OPTION_ARG_NONE, &rm_fifo_at_exit, "if set, drop fifo at then end of the program (you have to use --fifo option of course)", NULL } + { "rm-fifo-at-exit", 'r', 0, G_OPTION_ARG_NONE, &rm_fifo_at_exit, "if set, drop fifo at then end of the program (you have to use --fifo option of course)", NULL }, + { NULL } }; #endif /* OPTIONS_H_ */