From 80f5461ae6c9e7b443b6845ca9dc341d530a04dd Mon Sep 17 00:00:00 2001 From: Noel Power Date: Wed, 10 Jul 2019 16:07:35 +0100 Subject: [PATCH] s3/lib: clang: Fix 'Value stored to 'b' is never read' Fixes: source3/lib/substitute.c:516:7: warning: Value stored to 'b' is never read <--[clang] for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) { ^ ~~~~~~~~~~~~ source3/lib/substitute.c:709:7: warning: Value stored to 'b' is never read <--[clang] for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) { ^ ~~~~~~~~~~~~ source3/lib/substitute.c:811:7: warning: Value stored to 'b' is never read <--[clang] for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) { ^ ~~~~~~~~~~~~ 3 warnings generated. Signed-off-by: Noel Power Reviewed-by: Gary Lockyer --- source3/lib/substitute.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c index ea227c5ab68d..f8ca6f41cc1a 100644 --- a/source3/lib/substitute.c +++ b/source3/lib/substitute.c @@ -513,7 +513,7 @@ char *talloc_sub_basic(TALLOC_CTX *mem_ctx, tmp_ctx = talloc_stackframe(); - for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) { + for (s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) { r = NULL; b = a_string; @@ -706,7 +706,7 @@ char *talloc_sub_specified(TALLOC_CTX *mem_ctx, goto done; } - for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) { + for (s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) { b = a_string; @@ -808,7 +808,7 @@ char *talloc_sub_advanced(TALLOC_CTX *ctx, return NULL; } - for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) { + for (s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) { b = a_string; -- 2.34.1