mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-18 03:20:59 -05:00
Macro wrapper on ctrl_radiobuttons to fill in the NULL.
ctrl_radiobuttons has a variadic argument list that it expects to be terminated by a null pointer where a const char * should be. So the terminating NULL at each call site ought to be cast to const char *, for the usual reason (NULL might expand literally to something not the same size as a pointer and get mis-marshalled in the variadic argument list). It wasn't being. Fixed in the same way as dupcat: I've turned ctrl_radiobuttons into a macro wrapper on the underlying function, which adds the NULL automatically with its correct cast. This also saves verbiage at every call site, because now I can leave out all the NULLs there.
This commit is contained in:
6
dialog.c
6
dialog.c
@ -282,9 +282,9 @@ dlgcontrol *ctrl_combobox(struct controlset *s, const char *label,
|
||||
* title is expected to be followed by a shortcut _iff_ `shortcut'
|
||||
* is NO_SHORTCUT.
|
||||
*/
|
||||
dlgcontrol *ctrl_radiobuttons(struct controlset *s, const char *label,
|
||||
char shortcut, int ncolumns, intorptr helpctx,
|
||||
handler_fn handler, intorptr context, ...)
|
||||
dlgcontrol *ctrl_radiobuttons_fn(struct controlset *s, const char *label,
|
||||
char shortcut, int ncolumns, intorptr helpctx,
|
||||
handler_fn handler, intorptr context, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int i;
|
||||
|
Reference in New Issue
Block a user