ARM assembler pack update from HEAD.
[openssl.git] / crypto / bn / bn_ctx.c
index 7010193033f9e8a139b55fede7210efcbbcbc817..3f2256f67575aeca46c110ba8416bfba1daa60af 100644 (file)
@@ -161,7 +161,7 @@ static void ctxdbg(BN_CTX *ctx)
        fprintf(stderr,"(%08x): ", (unsigned int)ctx);
        while(bnidx < ctx->used)
                {
-               fprintf(stderr,"%02x ", item->vals[bnidx++ % BN_CTX_POOL_SIZE].dmax);
+               fprintf(stderr,"%03x ", item->vals[bnidx++ % BN_CTX_POOL_SIZE].dmax);
                if(!(bnidx % BN_CTX_POOL_SIZE))
                        item = item->next;
                }
@@ -171,8 +171,8 @@ static void ctxdbg(BN_CTX *ctx)
        while(fpidx < stack->depth)
                {
                while(bnidx++ < stack->indexes[fpidx])
-                       fprintf(stderr,"   ");
-               fprintf(stderr,"^^ ");
+                       fprintf(stderr,"    ");
+               fprintf(stderr,"^^^ ");
                bnidx++;
                fpidx++;
                }
@@ -230,7 +230,10 @@ BN_CTX *BN_CTX_new(void)
 
 void BN_CTX_free(BN_CTX *ctx)
        {
+       if (ctx == NULL)
+               return;
 #ifdef BN_CTX_DEBUG
+       {
        BN_POOL_ITEM *pool = ctx->pool.head;
        fprintf(stderr,"BN_CTX_free, stack-size=%d, pool-bignums=%d\n",
                ctx->stack.size, ctx->pool.size);
@@ -242,6 +245,7 @@ void BN_CTX_free(BN_CTX *ctx)
                pool = pool->next;
        }
        fprintf(stderr,"\n");
+       }
 #endif
        BN_STACK_finish(&ctx->stack);
        BN_POOL_finish(&ctx->pool);