Commit 68bf1b1e462cf3deb61b932f79be607fa0ab82c5

Stefan Sperling 2018-11-07T08:43:13

unnecessary repeated strlen() in parse_tree_entry()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/object_parse.c b/lib/object_parse.c
index 6ec3f47..c119834 100644
--- a/lib/object_parse.c
+++ b/lib/object_parse.c
@@ -477,7 +477,7 @@ parse_tree_entry(struct got_tree_entry **te, size_t *elen, char *buf,
 		err = got_error(GOT_ERR_BAD_OBJ_DATA);
 		goto done;
 	}
-	buf += strlen(buf) + 1;
+	buf += *elen;
 	memcpy((*te)->id->sha1, buf, SHA1_DIGEST_LENGTH);
 	*elen += SHA1_DIGEST_LENGTH;
 done: