baddc

bad dc(1)
git clone git://bvnf.space/baddc.git
Log | Files | Refs

commit e448ae491292f244b8cdab8aa646218408b92b13
parent 59c261a78b8a7a493fd8e4670de935e3ac32bf2f
Author: phoebos <ben@bvnf.space>
Date:   Mon, 31 Jan 2022 00:14:55 +0000

support A-F hex input

Diffstat:
Mbaddc.c | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/baddc.c b/baddc.c @@ -135,6 +135,9 @@ int main(int argc, char **argv) { else if (isdigit(buf[i])) { curnum = (curnum * ibase) + (buf[i] - '0'); numready = 1; + } else if (buf[i] >= 'A' && buf[i] <= 'F') { + curnum = (curnum * ibase) + (buf[i] - 'A' + 10); + numready = 1; } else { if (numready) { push(curnum * neg);