mode ever failed to do this, and only Plink actually had a problem
with it, so this didn't become obvious for a while. rlogin mode is
fixed, and all implementations of from_backend() now contain an
assertion so that we should spot errors of this type more quickly in
future.
git-svn-id: svn://svn.tartarus.org/sgt/putty@1571
cda61777-01e9-0310-a592-
d414129be87e
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
+#include <assert.h>
#include <stdarg.h>
#define PUTTY_DO_GLOBALS /* actually _define_ globals */
HANDLE h = (is_stderr ? errhandle : outhandle);
int osize, esize;
+ assert(len > 0);
+
if (is_stderr) {
bufchain_add(&stderr_data, data, len);
try_output(1);
unsigned char *p = (unsigned char *) data;
unsigned len = (unsigned) datalen;
+ assert(len > 0);
+
/*
* stderr data is just spouted to local stderr and otherwise
* ignored.
}
firstbyte = 0;
}
- c_write(data, len);
+ if (len > 0)
+ c_write(data, len);
}
return 1;
}
unsigned char *p = (unsigned char *) data;
unsigned len = (unsigned) datalen;
+ assert(len > 0);
+
/*
* stderr data is just spouted to local stderr and otherwise
* ignored.
*/
int from_backend(int is_stderr, char *data, int len)
{
+ assert(len > 0);
+
bufchain_add(&inbuf, data, len);
/*