X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fber_int.c;h=e9b23a2fb0be99d27c347eb7af67352a33fa4cf0;hb=dbc40ad16aa82379d2884e106d79c7d83312667a;hp=f864cbe877ea08806f15157e527e6877819eee75;hpb=b97d1c530d7e111f3a4f9cfbb14220cc64561753;p=yaz-moved-to-github.git diff --git a/src/ber_int.c b/src/ber_int.c index f864cbe..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. * @@ -62,7 +62,8 @@ int ber_encinteger(ODR o, Odr_int val) { unsigned long long uval = val; unsigned char tmp[sizeof(uval)]; - int i, len; + int len; + size_t i; for (i = sizeof(uval); i > 0; ) { tmp[--i] = uval; @@ -94,13 +95,13 @@ int ber_decinteger(const unsigned char *buf, Odr_int *val, int max) 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];