diff options
Diffstat (limited to 'libtommath/bn_mp_add_d.c')
-rw-r--r-- | libtommath/bn_mp_add_d.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libtommath/bn_mp_add_d.c b/libtommath/bn_mp_add_d.c index fde3cee..d472353 100644 --- a/libtommath/bn_mp_add_d.c +++ b/libtommath/bn_mp_add_d.c @@ -37,8 +37,9 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c) /* c = |a| - b */ res = mp_sub_d(a, b, c); - /* fix sign */ - a->sign = c->sign = MP_NEG; + /* fix signs */ + a->sign = MP_NEG; + c->sign = (c->used) ? MP_NEG : MP_ZPOS; return res; } @@ -105,5 +106,5 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c) #endif /* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_add_d.c,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:31:56 $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/10/08 14:42:54 $ */ |