Mercurial > dropbear
diff bignum.c @ 1256:506f7681d0f8 coverity
merge up to date
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 15 Mar 2016 22:45:43 +0800 |
parents | 2bb4c662d1c2 |
children | c98e242dc505 |
line wrap: on
line diff
--- a/bignum.c Tue Dec 15 22:24:34 2015 +0800 +++ b/bignum.c Tue Mar 15 22:45:43 2016 +0800 @@ -39,33 +39,33 @@ * on error */ void m_mp_init_multi(mp_int *mp, ...) { - mp_int* cur_arg = mp; - va_list args; + mp_int* cur_arg = mp; + va_list args; - va_start(args, mp); /* init args to next argument from caller */ - while (cur_arg != NULL) { - if (mp_init(cur_arg) != MP_OKAY) { + va_start(args, mp); /* init args to next argument from caller */ + while (cur_arg != NULL) { + if (mp_init(cur_arg) != MP_OKAY) { dropbear_exit("Mem alloc error"); - } - cur_arg = va_arg(args, mp_int*); - } - va_end(args); + } + cur_arg = va_arg(args, mp_int*); + } + va_end(args); } void m_mp_alloc_init_multi(mp_int **mp, ...) { - mp_int** cur_arg = mp; - va_list args; + mp_int** cur_arg = mp; + va_list args; - va_start(args, mp); /* init args to next argument from caller */ - while (cur_arg != NULL) { - *cur_arg = m_malloc(sizeof(mp_int)); - if (mp_init(*cur_arg) != MP_OKAY) { + va_start(args, mp); /* init args to next argument from caller */ + while (cur_arg != NULL) { + *cur_arg = m_malloc(sizeof(mp_int)); + if (mp_init(*cur_arg) != MP_OKAY) { dropbear_exit("Mem alloc error"); - } - cur_arg = va_arg(args, mp_int**); - } - va_end(args); + } + cur_arg = va_arg(args, mp_int**); + } + va_end(args); } void bytes_to_mp(mp_int *mp, const unsigned char* bytes, unsigned int len) {