X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Fwrbuf.c;h=5f845650332b8bb79863deb2e5f6fcb93a9ea59a;hb=83b2f733ce31f24ea6bbe014907552e58826a9dd;hp=5b416f656c353856c05925b0ef8da8a745f61183;hpb=9bf9aa776b136ecaddb3193da79639a70f1f8a6f;p=yaz-moved-to-github.git diff --git a/util/wrbuf.c b/util/wrbuf.c index 5b416f6..5f84565 100644 --- a/util/wrbuf.c +++ b/util/wrbuf.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: wrbuf.c,v $ - * Revision 1.6 1999-10-28 11:36:40 adam + * Revision 1.7 1999-11-03 09:05:56 adam + * Implemented wrbuf_puts. + * + * 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 @@ -85,3 +88,10 @@ int wrbuf_write(WRBUF b, const char *buf, int size) b->pos += size; return 0; } + +int wrbuf_puts(WRBUF b, const char *buf) +{ + wrbuf_write(b, buf, strlen(buf)+1); /* '\0'-terminate as well */ + (b->pos)--; /* don't include '\0' in count */ + return 0; +}