Re: [PATCH v2 11/53] fast-import: convert to struct object_id

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/30/2017 07:29 PM, brian m. carlson wrote:
@@ -391,10 +391,8 @@ static void write_branch_report(FILE *rpt, struct branch *b)
 	fputc('\n', rpt);

 	fprintf(rpt, "  tip commit  : %s\n", oid_to_hex(&b->oid));
-	fprintf(rpt, "  old tree    : %s\n",
-		oid_to_hex(&b->branch_tree.versions[0].oid));
-	fprintf(rpt, "  cur tree    : %s\n",
-		oid_to_hex(&b->branch_tree.versions[1].oid));
+	fprintf(rpt, "  old tree    : %s\n", oid_to_hex(&b->branch_tree.versions[0].oid));
+	fprintf(rpt, "  cur tree    : %s\n", oid_to_hex(&b->branch_tree.versions[1].oid));
 	fprintf(rpt, "  commit clock: %" PRIuMAX "\n", b->last_commit);

 	fputs("  last pack   : ", rpt);

These look like unnecessary line rewrappings.

@@ -2298,8 +2296,12 @@ static uintmax_t do_change_note_fanout(
 static uintmax_t change_note_fanout(struct tree_entry *root,
 		unsigned char fanout)
 {
-	char hex_sha1[40], path[60];
-	return do_change_note_fanout(root, root, hex_sha1, 0, path, 0, fanout);
+	/*
+	 * The size of path is due to one slash between every two hex digits,
+	 * plus the terminating NUL.
+	 */
+	char hex_oid[GIT_MAX_HEXSZ], path[GIT_MAX_HEXSZ * 3 / 2];

If your comment is correct, shouldn't the size of path be 61 (that is, add "+ 1")? I took a look at do_change_note_fanout() and your comment seems correct.

+	return do_change_note_fanout(root, root, hex_oid, 0, path, 0, fanout);
 }

 /*

Other than these, patches 10 and 11 look fine.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]