summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Lopez <seniorlopez@gmail.com>2017-03-02 15:32:00 -0800
committerBrian Lopez <seniorlopez@gmail.com>2017-03-02 15:32:00 -0800
commit06f2e3d0ce58d830cf561da6f6d4759b7278515f (patch)
tree9028130bd243228390b164d22ba2da6305f133c8
parentba45438d283c279a8a4c585390b25567bc6618e4 (diff)
downloadlibgit2-06f2e3d0ce58d830cf561da6f6d4759b7278515f.tar.gz
bring declaration outside of for loop statement body
-rw-r--r--src/attr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/attr.c b/src/attr.c
index 6c3d14ef2..559f5353e 100644
--- a/src/attr.c
+++ b/src/attr.c
@@ -651,10 +651,11 @@ static int collect_attr_files(
if (!error) {
int length = strlen(path);
char *attr_file_parent_path = malloc((length + 1) * sizeof(char));
+ int i;
// Then push potential gitattribute files along the path components
// of the full file path.
- for (int i = 0; i < length; i++) {
+ for (i = 0; i < length; i++) {
if (path[i] == '/') {
strncpy(attr_file_parent_path, path, i);