Declare the variables inside the loop, to make it more obvious that
their values are not carried across loop iterations.
Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: Junio C Hamano <redacted>
void *buf;
struct tree_desc desc;
struct name_entry entry;
- int len, path_len;
- unsigned char type;
- struct leaf_node *l;
buf = fill_tree_descriptor(&desc, subtree->val_oid.hash);
if (!buf)
assert(prefix_len * 2 >= n);
memcpy(object_oid.hash, subtree->key_oid.hash, prefix_len);
while (tree_entry(&desc, &entry)) {
- path_len = strlen(entry.path);
+ unsigned char type;
+ struct leaf_node *l;
+ int len, path_len = strlen(entry.path);
+
len = get_oid_hex_segment(entry.path, path_len,
object_oid.hash + prefix_len, GIT_SHA1_RAWSZ - prefix_len);
if (len < 0)