klisp

an open source interpreter for the Kernel Programming Language.
git clone http://git.hanabi.in/repos/klisp.git
Log | Files | Refs | README

commit 8d305dedafcf4dc32fc6b7fa7c9fce29ff7b7bca
parent d3e64f1fc858dbd22132f8010034658d0e904789
Author: Andres Navarro <canavarro82@gmail.com>
Date:   Sun, 10 Apr 2011 19:50:28 -0300

Bugfix: added missing parens in the code to calculate the buffer size to print bigints.

Diffstat:
Msrc/kwrite.c | 6++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/kwrite.c b/src/kwrite.c @@ -40,9 +40,8 @@ void kwrite_error(klisp_State *K, char *msg) void kw_print_bigint(klisp_State *K, TValue bigint) { - int32_t size = kbigint_print_size(bigint, 10) + - (kbigint_negativep(bigint))? 1 : 0; - + int32_t size = kbigint_print_size(bigint, 10) + + ((kbigint_negativep(bigint))? 1 : 0); TValue buf_str = kstring_new_g(K, size); /* write backwards so we can use printf later */ @@ -59,7 +58,6 @@ void kw_print_bigint(klisp_State *K, TValue bigint) /* XXX: use to_digit function */ *buf-- = '0' + digit; } - if (kbigint_negativep(bigint)) *buf-- = '-';