X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fwrbuf.c;h=973f0802a11195ba11f31bb84ea9aed1007a50dd;hp=e8e6434230bbb624e6b8b5e2516bbcfd3ff74926;hb=3eba413ef7e80467c7831731a8e35c733e447c47;hpb=1e2d8a4038fdada537fc10ff0eb9c52b338a8f9d diff --git a/src/wrbuf.c b/src/wrbuf.c index e8e6434..973f080 100644 --- a/src/wrbuf.c +++ b/src/wrbuf.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: wrbuf.c,v 1.16 2007-02-23 10:15:01 adam Exp $ + * $Id: wrbuf.c,v 1.17 2007-03-18 12:59:56 adam Exp $ */ /** @@ -231,6 +231,13 @@ const char *wrbuf_cstr(WRBUF b) return b->buf; } +void wrbuf_cut_right(WRBUF b, size_t no_to_remove) +{ + if (no_to_remove > b->pos) + no_to_remove = b->pos; + b->pos = b->pos - no_to_remove; +} + /* * Local variables: * c-basic-offset: 4