From c0e14c93609fd436931caaf49d89fb6d2f2c6ea5 Mon Sep 17 00:00:00 2001 From: David McMackins II Date: Thu, 16 Feb 2017 12:02:20 -0600 Subject: Fix printing negative E values --- src/util.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/util.c b/src/util.c index 867828a..cfa7fc0 100644 --- a/src/util.c +++ b/src/util.c @@ -1,6 +1,6 @@ /* * LiberTI - TI-like calculator designed for LibreCalc - * Copyright (C) 2016 Delwink, LLC + * Copyright (C) 2016-2017 Delwink, LLC * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -46,10 +46,14 @@ load_expr_num (struct tib_expr *dest, const char *src) if (e >= 0) { tib_expr_delete (dest, e); - dest->data[e] = TIB_CHAR_EPOW10; + + if ('+' == dest->data[e]) + dest->data[e] = TIB_CHAR_EPOW10; + else + rc = tib_expr_insert (dest, e, TIB_CHAR_EPOW10); } - return 0; + return rc; } const char * -- cgit v1.2.3