Skip to content

Commit bc5a7d6

Browse files
committed
Fix --help output for options without a short flag (again).
The simulator --help output container unprintable characters for options without a short flag. This was previously fixed in 34a32a2 but broken again in 037c835. This reverts the relevant lines to the upstream version.
1 parent cf541be commit bc5a7d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

c_emulator/riscv_sim.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ static void print_usage(const char *argv0, int ec)
172172
#endif
173173
struct option *opt = options;
174174
while (opt->name) {
175-
if (opt->flag == NULL)
175+
if (isprint(opt->val))
176176
fprintf(stdout, "\t -%c\t --%s\n", (char)opt->val, opt->name);
177177
else
178-
fprintf(stdout, "\t\t --%s\n", opt->name);
178+
fprintf(stdout, "\t \t --%s\n", opt->name);
179179
opt++;
180180
}
181181
exit(ec);

0 commit comments

Comments
 (0)