From d6987458f21cf1890045f2606d0f8ec4d2225b44 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 3 Mar 2016 23:02:59 +0100 Subject: Cleanup and fix bug in ztrunc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/zsetu.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/zsetu.c') diff --git a/src/zsetu.c b/src/zsetu.c index c3c3510..2e60c28 100644 --- a/src/zsetu.c +++ b/src/zsetu.c @@ -1,8 +1,6 @@ /* See LICENSE file for copyright and license details. */ #include "internals" -#include - #define SIZE_MULTIPLE(fit, in) ((sizeof(fit) + sizeof(in) - 1) / sizeof(in)) @@ -13,10 +11,8 @@ zsetu(z_t a, unsigned long long int b) SET_SIGNUM(a, 0); return; } - if (a->alloced < SIZE_MULTIPLE(b, *(a->chars))) { - a->alloced = SIZE_MULTIPLE(b, *(a->chars)); - a->chars = realloc(a->chars, SIZE_MULTIPLE(b, *(a->chars)) * sizeof(*(a->chars))) - } + if (a->alloced < SIZE_MULTIPLE(b, *(a->chars))) + zahl_realloc(a, SIZE_MULTIPLE(b, *(a->chars))) SET_SIGNUM(a, 1); a->used = 0; while (b) { -- cgit v1.2.3-70-g09d2