summaryrefslogtreecommitdiffstats
path: root/libtommath/bn_mp_shrink.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtommath/bn_mp_shrink.c')
-rw-r--r--libtommath/bn_mp_shrink.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/libtommath/bn_mp_shrink.c b/libtommath/bn_mp_shrink.c
index 4b8c5ef..e81973d 100644
--- a/libtommath/bn_mp_shrink.c
+++ b/libtommath/bn_mp_shrink.c
@@ -16,17 +16,20 @@
*/
/* shrink a bignum */
-int mp_shrink (mp_int * a)
+int mp_shrink(mp_int * a)
{
- mp_digit *tmp;
- if (a->alloc != a->used && a->used > 0) {
- if ((tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * a->used)) == NULL) {
- return MP_MEM;
- }
- a->dp = tmp;
- a->alloc = a->used;
- }
- return MP_OKAY;
+ mp_digit *tmp;
+ if (a->alloc != a->used && a->used > 0) {
+ if ((tmp =
+ OPT_CAST(mp_digit) XREALLOC(a->dp,
+ sizeof(mp_digit) * a->used)) ==
+ NULL) {
+ return MP_MEM;
+ }
+ a->dp = tmp;
+ a->alloc = a->used;
+ }
+ return MP_OKAY;
}
#endif