Re: [PATCH 08/12] pack-write: switch various SHA-1 values to abstract forms

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

 



On 28/01/2018 16:57, brian m. carlson wrote:
  		if (partial_pack_offset == 0) {
-			unsigned char sha1[20];
-			git_SHA1_Final(sha1, &old_sha1_ctx);
-			if (hashcmp(sha1, partial_pack_sha1) != 0)
+			unsigned char hash[GIT_MAX_RAWSZ];
+			the_hash_algo->final_fn(hash, &old_hash_ctx);
+			if (hashcmp(hash, partial_pack_hash) != 0)

Maybe "hash" should be struct object_id here?

  char *index_pack_lockfile(int ip_out)
  {
-	char packname[46];
+	char packname[GIT_MAX_HEXSZ + 6];
+	int len = the_hash_algo->hexsz + 6;

Just me nitpicking, but "len" can be const :)

--
| ← Ceci n'est pas une pipe
Patryk Obara



[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]

  Powered by Linux