From 29aa487a4e2f30795b9140d2cfebb8c904751f89 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 24 Jul 2021 16:16:29 -0700 Subject: [PATCH] exsubstr: remove some unnecessary bracketing --- lib/expr/exeval.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/expr/exeval.c b/lib/expr/exeval.c index eb50fbad1..6913482b6 100644 --- a/lib/expr/exeval.c +++ b/lib/expr/exeval.c @@ -985,11 +985,11 @@ static Extype_t exsubstr(Expr_t * ex, Exnode_t * expr, void *env) s = eval(ex, expr->data.string.base, env); len = strlen(s.string); i = eval(ex, expr->data.string.pat, env); - if ((i.integer < 0) || (len < i.integer)) + if (i.integer < 0 || len < i.integer) exerror("illegal start index in substr(%s,%d)", s.string, i.integer); if (expr->data.string.repl) { l = eval(ex, expr->data.string.repl, env); - if ((l.integer < 0) || (len - i.integer < l.integer)) + if (l.integer < 0 || len - i.integer < l.integer) exerror("illegal length in substr(%s,%d,%d)", s.string, i.integer, l.integer); } else l.integer = len - i.integer; -- 2.40.0