projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
18ed9f1
)
wrbuf_write allows zero buffer length.
author
Adam Dickmeiss
<adam@indexdata.dk>
Thu, 28 Oct 1999 11:36:40 +0000
(11:36 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Thu, 28 Oct 1999 11:36:40 +0000
(11:36 +0000)
util/wrbuf.c
patch
|
blob
|
history
diff --git
a/util/wrbuf.c
b/util/wrbuf.c
index
4cfc8d8
..
5b416f6
100644
(file)
--- a/
util/wrbuf.c
+++ b/
util/wrbuf.c
@@
-4,7
+4,10
@@
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: wrbuf.c,v $
* 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
* 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)
{
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);
if (b->pos + size >= b->size)
wrbuf_grow(b, size);
memcpy(b->buf + b->pos, buf, size);