treewide: tighten variable scope in loops (#18372)

Also use _cleanup_free_ in one more place.
This commit is contained in:
Susant Sahani
2021-01-27 08:19:39 +01:00
committed by GitHub
parent 37baf8db56
commit fe96c0f86d
30 changed files with 74 additions and 127 deletions

View File

@@ -862,9 +862,8 @@ char *strextend_with_separator_internal(char **x, const char *separator, ...) {
}
char *strrep(const char *s, unsigned n) {
size_t l;
char *r, *p;
unsigned i;
size_t l;
assert(s);
@@ -873,7 +872,7 @@ char *strrep(const char *s, unsigned n) {
if (!r)
return NULL;
for (i = 0; i < n; i++)
for (unsigned i = 0; i < n; i++)
p = stpcpy(p, s);
*p = 0;