This commit is contained in:
Přemysl Eric Janouch 2017-05-25 13:50:42 +02:00
parent 3929106e5d
commit cc302bc17c
Signed by: p
GPG Key ID: B715679E3A361BE6
1 changed files with 6 additions and 1 deletions

7
ell.c
View File

@ -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");