From 9bf9aa776b136ecaddb3193da79639a70f1f8a6f Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 28 Oct 1999 11:36:40 +0000 Subject: [PATCH] wrbuf_write allows zero buffer length. --- util/wrbuf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/wrbuf.c b/util/wrbuf.c index 4cfc8d8..5b416f6 100644 --- a/util/wrbuf.c +++ b/util/wrbuf.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: wrbuf.c,v $ - * Revision 1.5 1999-08-27 09:40:32 adam + * Revision 1.6 1999-10-28 11:36:40 adam + * wrbuf_write allows zero buffer length. + * + * Revision 1.5 1999/08/27 09:40:32 adam * Renamed logf function to yaz_log. Removed VC++ project files. * * Revision 1.4 1998/02/11 11:53:36 adam @@ -74,6 +77,8 @@ int wrbuf_grow(WRBUF b, int minsize) int wrbuf_write(WRBUF b, const char *buf, int size) { + if (size <= 0) + return 0; if (b->pos + size >= b->size) wrbuf_grow(b, size); memcpy(b->buf + b->pos, buf, size); -- 1.7.10.4