From 31a2017af5fd3c279fce362469a5894882db89c6 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 13 Feb 2018 19:45:54 +0000 Subject: [PATCH] Add missing casts in dupcat(). Ahem. I _spotted_ this in code review, and forgot to make the change before pushing! Because it's legitimate for a C implementation to define 'NULL' so that it expands to just 0, it follows that if you use NULL in a variadic argument list where the callee will expect to extract a pointer, you run the risk of putting an int-sized rather than pointer-sized argument on the list and causing the consumer to get out of sync. So you have to add an explicit cast. --- unix/gtkdlg.c | 2 +- windows/windlg.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/gtkdlg.c b/unix/gtkdlg.c index 67d0786a..0cb8b7e0 100644 --- a/unix/gtkdlg.c +++ b/unix/gtkdlg.c @@ -3960,7 +3960,7 @@ void showeventlog(void *estuff, void *parentwin) c->listbox.percentages[2] = 65; es->window = window = our_dialog_new(); - title = dupcat(appname, " Event Log", NULL); + title = dupcat(appname, " Event Log", (const char *)NULL); gtk_window_set_title(GTK_WINDOW(window), title); sfree(title); w0 = layout_ctrls(&es->dp, &es->scs, s0, GTK_WINDOW(window)); diff --git a/windows/windlg.c b/windows/windlg.c index 94e5ad93..352ae1fc 100644 --- a/windows/windlg.c +++ b/windows/windlg.c @@ -779,7 +779,7 @@ void logevent(void *frontend, const char *string) if (*location) sfree(*location); - *location = dupcat(timebuf, string, NULL); + *location = dupcat(timebuf, string, (const char *)NULL); if (logbox) { int count; SendDlgItemMessage(logbox, IDN_LIST, LB_ADDSTRING,