mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
Add memsets after allocation of all Backend implementors.
Now every struct that implements the Backend trait is completely cleared before we start initialising any of its fields. This will mean I can add new fields that default to 0 or NULL, without having to mess around initialising them explicitly everywhere.
This commit is contained in:
@ -414,6 +414,7 @@ static void pty_open_master(Pty *pty)
|
||||
static Pty *new_pty_struct(void)
|
||||
{
|
||||
Pty *pty = snew(Pty);
|
||||
memset(pty, 0, sizeof(Pty));
|
||||
pty->conf = NULL;
|
||||
pty->pending_eof = false;
|
||||
bufchain_init(&pty->output_data);
|
||||
|
@ -294,6 +294,7 @@ static char *serial_init(const BackendVtable *vt, Seat *seat,
|
||||
seat_set_trust_status(seat, false);
|
||||
|
||||
serial = snew(Serial);
|
||||
memset(serial, 0, sizeof(Serial));
|
||||
serial->backend.vt = vt;
|
||||
*backend_handle = &serial->backend;
|
||||
|
||||
|
Reference in New Issue
Block a user