1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Const-correctness in do_select() return value.

The error message it returns on failure is a string literal, so it
shouldn't be returned as a mutable 'char *'.
This commit is contained in:
Simon Tatham 2020-01-01 15:46:59 +00:00
parent b89d17fbca
commit 58e2a35bdf
4 changed files with 6 additions and 6 deletions

View File

@ -845,7 +845,7 @@ static const SocketVtable NetSocket_sockvt = {
static Socket *sk_net_accept(accept_ctx_t ctx, Plug *plug) static Socket *sk_net_accept(accept_ctx_t ctx, Plug *plug)
{ {
DWORD err; DWORD err;
char *errstr; const char *errstr;
NetSocket *ret; NetSocket *ret;
/* /*
@ -897,7 +897,7 @@ static DWORD try_connect(NetSocket *sock)
#endif #endif
SOCKADDR_IN a; SOCKADDR_IN a;
DWORD err; DWORD err;
char *errstr; const char *errstr;
short localport; short localport;
int family; int family;
@ -1137,7 +1137,7 @@ Socket *sk_newlistener(const char *srcaddr, int port, Plug *plug,
SOCKADDR_IN a; SOCKADDR_IN a;
DWORD err; DWORD err;
char *errstr; const char *errstr;
NetSocket *ret; NetSocket *ret;
int retcode; int retcode;

View File

@ -45,7 +45,7 @@ SOCKET winselcli_unique_socket(void)
return *p; return *p;
} }
char *do_select(SOCKET skt, bool enable) const char *do_select(SOCKET skt, bool enable)
{ {
/* Check everything's been set up, for convenience of callers. */ /* Check everything's been set up, for convenience of callers. */
winselcli_setup(); winselcli_setup();

View File

@ -18,7 +18,7 @@ void winselgui_clear_hwnd(void)
winsel_hwnd = NULL; winsel_hwnd = NULL;
} }
char *do_select(SOCKET skt, bool enable) const char *do_select(SOCKET skt, bool enable)
{ {
int msg, events; int msg, events;
if (enable) { if (enable) {

View File

@ -352,7 +352,7 @@ DECL_WINDOWS_FUNCTION(GLOBAL, int, select,
* Implemented differently depending on the client of winnet.c, and * Implemented differently depending on the client of winnet.c, and
* called by winnet.c to turn on or off WSA*Select for a given socket. * called by winnet.c to turn on or off WSA*Select for a given socket.
*/ */
char *do_select(SOCKET skt, bool enable); const char *do_select(SOCKET skt, bool enable);
/* /*
* Exports from winselgui.c and winselcli.c, each of which provides an * Exports from winselgui.c and winselcli.c, each of which provides an