baddc

integer-precision dc(1)
git clone git://bvnf.space/baddc.git
Log | Files | Refs | README

commit 601330a6effb1d6b9c5c9894e0b1d4ab1ceda782
parent 6d5ee31223856fc1f75f83ce1c4e6fd3ba6fb002
Author: phoebos <ben@bvnf.space>
Date:   Wed, 25 May 2022 17:54:37 +0100

fix output base check

Diffstat:
MREADME | 2++
Mbaddc.1 | 2++
Mbaddc.c | 2+-
3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/README b/README @@ -82,6 +82,8 @@ BUGS The only supported values of output base are 8, 10, 16. + Signed numbers are only printed correctly with an output base of 10. + AUTHORS phoebos <ben@bvnf.space> diff --git a/baddc.1 b/baddc.1 @@ -102,5 +102,7 @@ rounding which may be lossy. The only supported values of input base are 1-16. .Pp The only supported values of output base are 8, 10, 16. +.Pp +Signed numbers are only printed correctly with an output base of 10. .Sh AUTHORS .An phoebos Aq Mt ben@bvnf.space diff --git a/baddc.c b/baddc.c @@ -144,7 +144,7 @@ void o_base(void) { } int o = pop(); - if (o != 8 || o != 10 || o != 16) + if (o != 8 && o != 10 && o != 16) fprintf(stderr, "output base %d not supported!\n", o); else obase = o;