From: Noel Power Date: Wed, 10 Jul 2019 15:07:35 +0000 (+0100) Subject: s3/lib: clang: Fix 'Value stored to 'b' is never read' X-Git-Tag: talloc-2.3.0~85 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=80f5461ae6c9e7b443b6845ca9dc341d530a04dd;p=thirdparty%2Fsamba.git 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 --- diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c index ea227c5ab68..f8ca6f41cc1 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;