mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Minor compiler nits:
- use smalloc/sfree, not malloc/free - include <ctype.h> - include <string.h> (although this doesn't shut the compiler up about non-ANSI stricmp/strnicmp) [originally from svn r2121]
This commit is contained in:
parent
bdb47167d1
commit
c0a3c62f6a
6
proxy.c
6
proxy.c
@ -8,6 +8,8 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#define DEFINE_PLUG_METHOD_MACROS
|
#define DEFINE_PLUG_METHOD_MACROS
|
||||||
#include "putty.h"
|
#include "putty.h"
|
||||||
@ -646,7 +648,7 @@ int proxy_socks4_negotiate (Proxy_Socket p, int change)
|
|||||||
}
|
}
|
||||||
|
|
||||||
length = strlen(cfg.proxy_username) + 9;
|
length = strlen(cfg.proxy_username) + 9;
|
||||||
command = (char*) malloc(length);
|
command = (char*) smalloc(length);
|
||||||
strcpy(command + 8, cfg.proxy_username);
|
strcpy(command + 8, cfg.proxy_username);
|
||||||
|
|
||||||
command[0] = 4; /* version 4 */
|
command[0] = 4; /* version 4 */
|
||||||
@ -660,7 +662,7 @@ int proxy_socks4_negotiate (Proxy_Socket p, int change)
|
|||||||
sk_addrcopy(p->remote_addr, command + 4);
|
sk_addrcopy(p->remote_addr, command + 4);
|
||||||
|
|
||||||
sk_write(p->sub_socket, command, length);
|
sk_write(p->sub_socket, command, length);
|
||||||
free(command);
|
sfree(command);
|
||||||
|
|
||||||
p->state = 1;
|
p->state = 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user