X-Git-Url: https://secure.softndesign.org/git/?a=blobdiff_plain;f=parser.c;fp=parser.c;h=77013e389665d0968da61faa83f8575e14d3d59f;hb=0b69fdfbcd1174e83284c2bf984fd334b0ba679e;hp=119733f9afb4e613347558d9db50cc0f367a9f06;hpb=743e93f0edf2c7779d0af4e16e17662994e0caaf;p=calc.git diff --git a/parser.c b/parser.c index 119733f..77013e3 100644 --- a/parser.c +++ b/parser.c @@ -641,9 +641,9 @@ int format (int precision) void base (int in, int out) { - if (in > 0) { + if ((in > 0) && (in < 37)) { set_base (in, in); - if (out > 0) { + if ((out > 0) && (out < 37)) { set_base (in, out); } else if (out != - 1) { VERBOSE (WARNING, fprintf (stdout, "error incorrect output base (%d)\n", out)); @@ -931,7 +931,7 @@ double evaluate_element (element_t *root, char mask) case Precision: return format ((int)op0); case Base: - base (op0, op1); + base ((int)op0, (int)op1); break; }