--- expr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/expr.c b/expr.c index 3afb94b..044c6c1 100644 --- a/expr.c +++ b/expr.c _AT_@ -21,7 +21,13 @@ static void tonum(struct val *v) { const char *errstr; - long long d = strtonum(v->str, LLONG_MIN, LLONG_MAX, &errstr); + long long d; + + /* check if val is the result of an earlier calculation */ + if (!v->str) + return; + + d = strtonum(v->str, LLONG_MIN, LLONG_MAX, &errstr); if (errstr) enprintf(2, "error: expected integer, got %s\n", v->str); v->num = d; -- 2.43.0Received on Mon Jan 22 2024 - 22:18:10 CET
This archive was generated by hypermail 2.3.0 : Mon Jan 22 2024 - 22:24:34 CET