X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fber_int.c;h=8eac32e5d0e57ae93ec16402d7d79012e689eb52;hb=00537b483d646bd04a204708ecbde708861f044e;hp=d181671e9a2478e237c20179f7d91c6a07d71aa4;hpb=f1717bac2bc62456bcd4fa5f727f9a74d12122d1;p=yaz-moved-to-github.git diff --git a/src/ber_int.c b/src/ber_int.c index d181671..8eac32e 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-2009 Index Data + * Copyright (C) 1995-2012 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];