diff --git a/library/bignum.c b/library/bignum.c index f6e50b986..54ab7e3ec 100644 --- a/library/bignum.c +++ b/library/bignum.c @@ -572,7 +572,10 @@ int mbedtls_mpi_write_string( const mbedtls_mpi *X, int radix, mbedtls_mpi_init( &T ); if( X->s == -1 ) + { *p++ = '-'; + buflen--; + } if( radix == 16 ) {