console: argtable3: fix -Wwrite-strings warnings

Re-apply commit 744c2dcdd9
This commit is contained in:
Ivan Grokhotkov
2022-04-05 19:59:08 +02:00
parent 499dbc2152
commit 5a8faed3dc

View File

@@ -668,9 +668,9 @@ void arg_print_option(FILE* fp, const char* shortopts, const char* longopts, con
*/ */
static void arg_print_gnuswitch_ds(arg_dstr_t ds, struct arg_hdr** table) { static void arg_print_gnuswitch_ds(arg_dstr_t ds, struct arg_hdr** table) {
int tabindex; int tabindex;
char* format1 = " -%c"; const char* format1 = " -%c";
char* format2 = " [-%c"; const char* format2 = " [-%c";
char* suffix = ""; const char* suffix = "";
/* print all mandatory switches that are without argument values */ /* print all mandatory switches that are without argument values */
for (tabindex = 0; table[tabindex] && !(table[tabindex]->flag & ARG_TERMINATOR); tabindex++) { for (tabindex = 0; table[tabindex] && !(table[tabindex]->flag & ARG_TERMINATOR); tabindex++) {