projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add input-focus support for System 7, where the Control Manager can't do
[u/mdw/putty]
/
winnet.c
diff --git
a/winnet.c
b/winnet.c
index
f617b0f
..
6bb135c
100644
(file)
--- a/
winnet.c
+++ b/
winnet.c
@@
-226,7
+226,7
@@
char *winsock_error_string(int error)
SockAddr sk_namelookup(const char *host, char **canonicalname)
{
SockAddr sk_namelookup(const char *host, char **canonicalname)
{
- SockAddr ret = s
malloc(sizeof(struct SockAddr_tag)
);
+ SockAddr ret = s
new(struct SockAddr_tag
);
unsigned long a;
struct hostent *h = NULL;
char realhost[8192];
unsigned long a;
struct hostent *h = NULL;
char realhost[8192];
@@
-357,14
+357,14
@@
SockAddr sk_namelookup(const char *host, char **canonicalname)
}
ret->address = ntohl(a);
realhost[lenof(realhost)-1] = '\0';
}
ret->address = ntohl(a);
realhost[lenof(realhost)-1] = '\0';
- *canonicalname = s
malloc(1+strlen(realhost)
);
+ *canonicalname = s
newn(1+strlen(realhost), char
);
strcpy(*canonicalname, realhost);
return ret;
}
SockAddr sk_nonamelookup(const char *host)
{
strcpy(*canonicalname, realhost);
return ret;
}
SockAddr sk_nonamelookup(const char *host)
{
- SockAddr ret = s
malloc(sizeof(struct SockAddr_tag)
);
+ SockAddr ret = s
new(struct SockAddr_tag
);
ret->error = NULL;
ret->family = AF_UNSPEC;
strncpy(ret->hostname, host, lenof(ret->hostname));
ret->error = NULL;
ret->family = AF_UNSPEC;
strncpy(ret->hostname, host, lenof(ret->hostname));
@@
-490,7
+490,7
@@
Socket sk_register(void *sock, Plug plug)
/*
* Create Socket structure.
*/
/*
* Create Socket structure.
*/
- ret = s
malloc(sizeof(struct Socket_tag)
);
+ ret = s
new(struct Socket_tag
);
ret->fn = &fn_table;
ret->error = NULL;
ret->plug = plug;
ret->fn = &fn_table;
ret->error = NULL;
ret->plug = plug;
@@
-553,7
+553,7
@@
Socket sk_new(SockAddr addr, int port, int privport, int oobinline,
/*
* Create Socket structure.
*/
/*
* Create Socket structure.
*/
- ret = s
malloc(sizeof(struct Socket_tag)
);
+ ret = s
new(struct Socket_tag
);
ret->fn = &fn_table;
ret->error = NULL;
ret->plug = plug;
ret->fn = &fn_table;
ret->error = NULL;
ret->plug = plug;
@@
-732,7
+732,7
@@
Socket sk_newlistener(char *srcaddr, int port, Plug plug, int local_host_only)
/*
* Create Socket structure.
*/
/*
* Create Socket structure.
*/
- ret = s
malloc(sizeof(struct Socket_tag)
);
+ ret = s
new(struct Socket_tag
);
ret->fn = &fn_table;
ret->error = NULL;
ret->plug = plug;
ret->fn = &fn_table;
ret->error = NULL;
ret->plug = plug;