unit: Remove loop initial declaration.
PATCH 1/1 unit: Remove loop initial declaration.
Move the variable declaration in test_string.c:test_strv_append() out of the for-loop initial declaration to support older C standards, as well as to conform to the ELL coding style.
--- unit/test-string.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
unit/test-string.c +3 -3
@@ -257,15 +257,15 @@ static void test_strv_append(const void *test_data) {const char *src[] = {"Foo" ,"Bar" };char **dst =NULL ; -size_t len =L_ARRAY_SIZE (src); +size_t i; -for (size_t i =0 ; i < len; i++) +for (i =0 ; i < len; i++) dst =l_strv_append (dst, src[i]);assert (l_strv_length (dst) == len); -for (size_t i =0 ; i < len; i++) +for (i =0 ; i < len; i++)assert (strcmp (src[i], dst[i]) ==0 );l_strv_free (dst);
Signature · 1 line
2.17.1
Denis Kenzior
AppliedHi Ossama,
Quoted 7 lines · Ossama Othman
Move the variable declaration in test_string.c:test_strv_append() out of the for-loop initial declaration to support older C standards, as well as to conform to the ELL coding style.
--- unit/test-string.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Applied, thanks.
Regards,
-Denis