projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove all the "assert(len>0)" which forbade zero-length writes across the
[u/mdw/putty]
/
psftp.c
diff --git
a/psftp.c
b/psftp.c
index
ca01f12
..
c7cd870
100644
(file)
--- a/
psftp.c
+++ b/
psftp.c
@@
-1639,14
+1639,13
@@
int from_backend(void *frontend, int is_stderr, const char *data, int datalen)
unsigned char *p = (unsigned char *) data;
unsigned len = (unsigned) datalen;
unsigned char *p = (unsigned char *) data;
unsigned len = (unsigned) datalen;
- assert(len > 0);
-
/*
* stderr data is just spouted to local stderr and otherwise
* ignored.
*/
if (is_stderr) {
/*
* stderr data is just spouted to local stderr and otherwise
* ignored.
*/
if (is_stderr) {
- fwrite(data, 1, len, stderr);
+ if (len > 0)
+ fwrite(data, 1, len, stderr);
return 0;
}
return 0;
}
@@
-1656,7
+1655,7
@@
int from_backend(void *frontend, int is_stderr, const char *data, int datalen)
if (!outptr)
return 0;
if (!outptr)
return 0;
- if (
outlen > 0
) {
+ if (
(outlen > 0) && (len > 0)
) {
unsigned used = outlen;
if (used > len)
used = len;
unsigned used = outlen;
if (used > len)
used = len;