Skip to content

Commit 5974617

Browse files
koffescfriedt
authored andcommitted
lib: getopt: Fix compiler warning.
current_dash may be used uninitialized Signed-off-by: Kristoffer Rist Skøien <kristoffer.skoien@nordicsemi.no>
1 parent 259ec41 commit 5974617

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/posix/getopt/getopt_long.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ parse_long_options(struct getopt_state *state, char * const *nargv,
172172
{
173173
char *current_argv, *has_equal;
174174
#ifdef GNU_COMPATIBLE
175-
char *current_dash;
175+
char *current_dash = "";
176176
#endif
177177
size_t current_argv_len;
178178
int i, match, exact_match, second_partial_match;
@@ -191,7 +191,6 @@ parse_long_options(struct getopt_state *state, char * const *nargv,
191191
current_dash = "-W ";
192192
break;
193193
default:
194-
current_dash = "";
195194
break;
196195
}
197196
}

0 commit comments

Comments
 (0)