[git commit] shell/math: explain why we use separate &end

Denys Vlasenko vda.linux at googlemail.com
Sun Jun 18 17:30:22 UTC 2023


commit: https://git.busybox.net/busybox/commit/?id=10cce8ae35654585a09d6e839dd502f04b81599d
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 shell/math.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shell/math.c b/shell/math.c
index 6784eeeb0..0b30e089d 100644
--- a/shell/math.c
+++ b/shell/math.c
@@ -706,7 +706,7 @@ evaluate_string(arith_state_t *math_state, const char *expr)
 			char *end;
 			numstackptr->var_name = NULL;
 			errno = 0;
-			end = (char*) expr; /* separate variable to go on stack */
+			/* code is smaller compared to using &expr here: */
 			numstackptr->val = strto_arith_t(expr, &end);
 			expr = end;
 			dbg("[%d] val:%lld", (int)(numstackptr - numstack), numstackptr->val);


More information about the busybox-cvs mailing list