X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fber_int.c;h=e9b23a2fb0be99d27c347eb7af67352a33fa4cf0;hp=d181671e9a2478e237c20179f7d91c6a07d71aa4;hb=e4e5f0bfaa1fcb5eb12cc37df216352df226b01e;hpb=f1717bac2bc62456bcd4fa5f727f9a74d12122d1 diff --git a/src/ber_int.c b/src/ber_int.c index d181671..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-2009 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];