X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fber_int.c;h=e9b23a2fb0be99d27c347eb7af67352a33fa4cf0;hp=ca3ea1098bdb47c17f0917a9a49d66a6937c1af4;hb=d2ed898832ae354c17254ff52c70c92278518efe;hpb=88d3bedf772316f87e1996f655ccf8d1e2589755 diff --git a/src/ber_int.c b/src/ber_int.c index ca3ea10..e9b23a2 100644 --- a/src/ber_int.c +++ b/src/ber_int.c @@ -1,9 +1,9 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2010 Index Data + * Copyright (C) 1995-2013 Index Data * See the file LICENSE for details. */ -/** +/** * \file ber_int.c * \brief Implements BER INTEGER encoding and decoding. * @@ -88,21 +88,20 @@ int ber_encinteger(ODR o, Odr_int val) int ber_decinteger(const unsigned char *buf, Odr_int *val, int max) { unsigned long long uval = 0; - int len; - size_t i; + int i, len; int res; const unsigned char *b = buf; if ((res = ber_declen(b, &len, max)) < 0) return -1; if (len+res > max || len < 0) /* out of bounds or indefinite encoding */ - return -1; + return -1; if (len > (int) sizeof(uval)) /* let's be reasonable, here */ return -1; b += res; if (*b & 0x80) - for (i = 0; i < sizeof(uval) - len; i++) + for (i = 0; i < (int) sizeof(uval) - len; i++) uval = (uval << 8) + 0xFF; for (i = 0; i < len; i++) uval = (uval << 8) + b[i];