mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
Introduced wrapper macros snew(), snewn() and sresize() for the
malloc functions, which automatically cast to the same type they're allocating the size of. Should prevent any future errors involving mallocing the size of the wrong structure type, and will also make life easier if we ever need to turn the PuTTY core code from real C into C++-friendly C. I haven't touched the Mac frontend in this checkin because I couldn't compile or test it. [originally from svn r3014]
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/* $Id: testback.c,v 1.6 2003/01/15 23:30:21 ben Exp $ */
|
||||
/* $Id: testback.c,v 1.7 2003/03/29 16:14:26 simon Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1999 Simon Tatham
|
||||
* Copyright (c) 1999 Ben Harris
|
||||
@ -77,7 +77,7 @@ static char *null_init(void *frontend_handle, void **backend_handle,
|
||||
static char *loop_init(void *frontend_handle, void **backend_handle,
|
||||
Config *cfg, char *host, int port, char **realhost,
|
||||
int nodelay) {
|
||||
struct loop_state *st = smalloc(sizeof(*st));
|
||||
struct loop_state *st = snew(struct loop_state);
|
||||
|
||||
st->term = frontend_handle;
|
||||
*backend_handle = st;
|
||||
|
Reference in New Issue
Block a user