X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/3ea863a3e893904b45674642afb3146bec8ce7e4..a460b361fe6734325bead016ef2dd39e4da302f4:/plink.c?ds=sidebyside diff --git a/plink.c b/plink.c index 76a974ef..3848214c 100644 --- a/plink.c +++ b/plink.c @@ -166,7 +166,8 @@ void try_output(int is_stderr) } } -int from_backend(void *frontend_handle, int is_stderr, char *data, int len) +int from_backend(void *frontend_handle, int is_stderr, + const char *data, int len) { int osize, esize; @@ -409,13 +410,13 @@ int main(int argc, char **argv) while (*p) { if (cmdlen >= cmdsize) { cmdsize = cmdlen + 512; - command = srealloc(command, cmdsize); + command = sresize(command, cmdsize, char); } command[cmdlen++]=*p++; } if (cmdlen >= cmdsize) { cmdsize = cmdlen + 512; - command = srealloc(command, cmdsize); + command = sresize(command, cmdsize, char); } command[cmdlen++]=' '; /* always add trailing space */ if (--argc) p = *++argv; @@ -548,6 +549,7 @@ int main(int argc, char **argv) } logctx = log_init(NULL, &cfg); back->provide_logctx(backhandle, logctx); + console_provide_logctx(logctx); sfree(realhost); } connopen = 1; @@ -649,7 +651,7 @@ int main(int argc, char **argv) /* Expand the buffer if necessary. */ if (i > sksize) { sksize = i + 16; - sklist = srealloc(sklist, sksize * sizeof(*sklist)); + sklist = sresize(sklist, sksize, SOCKET); } /* Retrieve the sockets into sklist. */