X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fber_int.c;h=40dbb0ce9853c20e09ac92af7d90c7d731dbb28a;hp=cc02d3b4202f1efeace6d57eef51d08b6804201e;hb=dca8928db421aa8750ac9ffead1a5c09a85f4f8b;hpb=c82db01c9fc0b51254ec6ead5fe3b503ca098ca0 diff --git a/src/ber_int.c b/src/ber_int.c index cc02d3b..40dbb0c 100644 --- a/src/ber_int.c +++ b/src/ber_int.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2013 Index Data + * Copyright (C) Index Data * See the file LICENSE for details. */ @@ -37,12 +37,12 @@ int ber_integer(ODR o, Odr_int *val) switch (o->direction) { case ODR_DECODE: - if ((res = ber_decinteger(o->bp, val, odr_max(o))) <= 0) + if ((res = ber_decinteger(o->op->bp, val, odr_max(o))) <= 0) { odr_seterror(o, OPROTO, 50); return 0; } - o->bp += res; + o->op->bp += res; return 1; case ODR_ENCODE: if ((res = ber_encinteger(o, *val)) < 0) @@ -66,7 +66,7 @@ int ber_encinteger(ODR o, Odr_int val) size_t i; for (i = sizeof(uval); i > 0; ) { - tmp[--i] = uval; + tmp[--i] = (unsigned char ) uval; /* only want lower 8 bits */ uval >>= 8; } for (i = 0; i < sizeof(uval)-1; i++)