X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=odr%2Fodr_mem.c;h=2ec348a7368949a34ba1dd81256b38f877ea6c3a;hp=9b2c7cc0afb3fe969007681e652b056103cd4932;hb=c71d717ada2a9ef730d527f161eb5ba9aa641a9f;hpb=569f86b4615c2731727be2a0ff898d36f9725819 diff --git a/odr/odr_mem.c b/odr/odr_mem.c index 9b2c7cc..2ec348a 100644 --- a/odr/odr_mem.c +++ b/odr/odr_mem.c @@ -1,8 +1,8 @@ /* - * Copyright (c) 1995-2002, Index Data + * Copyright (c) 1995-2003, Index Data * See the file LICENSE for details. * - * $Id: odr_mem.c,v 1.20 2002-07-25 12:51:08 adam Exp $ + * $Id: odr_mem.c,v 1.23 2003-03-18 13:34:35 adam Exp $ */ #if HAVE_CONFIG_H #include @@ -37,6 +37,11 @@ char *odr_strdup(ODR o, const char *str) return nmem_strdup(o->mem, str); } +char *odr_strdupn(ODR o, const char *str, size_t n) +{ + return nmem_strdupn(o->mem, str, n); +} + int *odr_intdup(ODR o, int v) { return nmem_intdup(o->mem, v); @@ -78,7 +83,7 @@ int odr_write(ODR o, unsigned char *buf, int bytes) { if (o->pos + bytes >= o->size && odr_grow_block(o, bytes)) { - o->error = OSPACE; + odr_seterror(o, OSPACE, 40); return -1; } memcpy(o->buf + o->pos, buf, bytes); @@ -96,7 +101,7 @@ int odr_seek(ODR o, int whence, int offset) offset += o->top; if (offset > o->size && odr_grow_block(o, offset - o->size)) { - o->error = OSPACE; + odr_seterror(o, OSPACE, 41); return -1; } o->pos = offset;