diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2017-05-25 13:50:42 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2017-05-25 13:50:42 +0200 |
commit | cc302bc17c515f20b72a2dc6db227159468c5495 (patch) | |
tree | fba4584c08d01bfbccad1301beef6e46bc0c6c6a /ell.c | |
parent | 3929106e5d6312eb2d94d0c1b1f99185cbcdb178 (diff) | |
download | ell-cc302bc17c515f20b72a2dc6db227159468c5495.tar.gz ell-cc302bc17c515f20b72a2dc6db227159468c5495.tar.xz ell-cc302bc17c515f20b72a2dc6db227159468c5495.zip |
Fix "-"
Diffstat (limited to 'ell.c')
-rw-r--r-- | ell.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1055,7 +1055,12 @@ defn (fn_plus) { } defn (fn_minus) { - double res = 0.0; + if (!args || args->type != ITEM_STRING) + return set_error (ctx, "first argument must be string"); + double res = strtod (args->value, NULL); + if (!(args = args->next)) + res = -res; + for (; args; args = args->next) { if (args->type != ITEM_STRING) return set_error (ctx, "arguments must be strings"); |