From: James Jones Date: Fri, 22 Apr 2022 20:23:51 +0000 (-0500) Subject: Get rid of superfluous test in loop in command_encode_dns_label (#4463) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c516164dbb4d5f8805ceeb40ee3532720e956298;p=thirdparty%2Ffreeradius-server.git Get rid of superfluous test in loop in command_encode_dns_label (#4463) By virtue of CC_HINT(nonnull), in, and hence p, will be non-NULL the first time through the loop. To take another iteration, next must be non-NULL, so that p, set to next + 1, will also be non-NULL; hence the "while (p)" is effectively "while (true)". --- diff --git a/src/bin/unit_test_attribute.c b/src/bin/unit_test_attribute.c index b0f0ee88797..dad289c5ff3 100644 --- a/src/bin/unit_test_attribute.c +++ b/src/bin/unit_test_attribute.c @@ -1745,7 +1745,7 @@ size_t command_encode_dns_label(command_result_t *result, command_file_ctx_t *cc enc_p = cc->buffer_start; - while (p) { + while (true) { fr_value_box_t *box = talloc_zero(NULL, fr_value_box_t); fr_skip_whitespace(p);