summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid McMackins II <contact@mcmackins.org>2017-02-16 12:02:20 -0600
committerDavid McMackins II <contact@mcmackins.org>2017-02-16 12:02:20 -0600
commitc0e14c93609fd436931caaf49d89fb6d2f2c6ea5 (patch)
tree5a1db1d1deb999dd0d9bfcee24250ff07cc73c84
parent288d5f4168f53648264ddb4ced49b14d9a4242c5 (diff)
Fix printing negative E values
-rw-r--r--src/util.c10
1 files 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 *