I added more detail to the `Authentication failed at PuTTY X11
[u/mdw/putty] / misc.c
diff --git a/misc.c b/misc.c
index 78d829a..1bd556e 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -1,3 +1,7 @@
+/*
+ * Platform-independent routines shared between all PuTTY programs.
+ */
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
@@ -181,6 +185,8 @@ void bufchain_add(bufchain *ch, const void *data, int len)
 {
     const char *buf = (const char *)data;
 
+    if (len == 0) return;
+
     ch->buffersize += len;
 
     if (ch->tail && ch->tail->buflen < BUFFER_GRANULE) {