1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -05:00

Make the backend_init error message dynamic. (NFC)

Now, instead of a 'const char *' in the static data segment, error
messages returned from backend setup are dynamically allocated and
freed by the caller.

This will allow me to make the messages much more specific (including
errno values and the like). However, this commit is pure refactoring:
I've _just_ changed the allocation policy, and left all the messages
alone.
This commit is contained in:
Simon Tatham
2020-04-18 13:28:33 +01:00
parent d9c4ce9fd8
commit df2994a05a
14 changed files with 88 additions and 87 deletions

View File

@ -368,9 +368,8 @@ static WinGuiSeat wgs = { .seat.vt = &win_seat_vt,
static void start_backend(void)
{
const struct BackendVtable *vt;
const char *error;
const char *title;
char *realhost;
char *error, *realhost;
int i;
/*
@ -397,6 +396,7 @@ static void start_backend(void)
char *str = dupprintf("%s Error", appname);
char *msg = dupprintf("Unable to open connection to\n%s\n%s",
conf_dest(conf), error);
sfree(error);
MessageBox(NULL, msg, str, MB_ICONERROR | MB_OK);
sfree(str);
sfree(msg);