mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 11:32:48 -05:00
Fix a couple of syntactically dangerous macros.
The live versions of the dmemdump macros had a trailing semicolon in the expansion, which would cause them to break if used in the wrong syntactic context (e.g. between if and else with the natural semicolon at the call site). The conditioned-out versions of those and of debug() itself expanded to the empty string in place of the more usual ((void)0). And SECOND_PASS_ONLY in gtkmain.c's command-line handling should have had the standard do ... while(0) wrapper to make it reliably a single statement.
This commit is contained in:
@ -330,7 +330,7 @@ bool do_cmdline(int argc, char **argv, bool do_everything, Conf *conf)
|
||||
} else \
|
||||
val = *++argv; \
|
||||
}
|
||||
#define SECOND_PASS_ONLY { if (!do_everything) continue; }
|
||||
#define SECOND_PASS_ONLY do { if (!do_everything) continue; } while (0)
|
||||
|
||||
while (--argc > 0) {
|
||||
const char *p = *++argv;
|
||||
|
Reference in New Issue
Block a user