Commit Diff


commit - 36e83e5eea8d1387c024006cc320e4ef9d545b16
commit + ea8d9c76cc8fdc1dacfcc1cb952769fcd0930b10
blob - 1cbce6b3ad5b6169b26f1ca72e58e3bb1bad9d7f
blob + 11ba3814d20b1e2326659222ac27df0feeb7f5d5
--- libexec/got-fetch-pack/got-fetch-pack.c
+++ libexec/got-fetch-pack/got-fetch-pack.c
@@ -550,7 +550,7 @@ fetch_pack(int fd, int packfd, uint8_t *pack_sha1,
 		acked++;
 	}
 
-	n = snprintf(buf, sizeof(buf), "done\n");
+	n = strlcpy(buf, "done\n", sizeof(buf));
 	err = got_pkt_writepkt(fd, buf, n, chattygot);
 	if (err)
 		goto done;
blob - a6b975ef7bcdec20b95cc40a92b212aba60abcf5
blob + 4406e5ce66cdd5c7694f7d12f528781f8c99c57b
--- libexec/got-index-pack/got-index-pack.c
+++ libexec/got-index-pack/got-index-pack.c
@@ -905,12 +905,10 @@ index_pack(struct got_pack *pack, int idxfd, FILE *tmp
 
 		}
 		if (pass++ > 3 && n == 0) {
-			static char msg[64];
-			snprintf(msg, sizeof(msg), "could not resolve "
-			    "any of deltas; packfile could be corrupt");
-			err = got_error_msg(GOT_ERR_BAD_PACKFILE, msg);
+			err = got_error_msg(GOT_ERR_BAD_PACKFILE,
+			    "could not resolve any of deltas; packfile could "
+			    "be corrupt");
 			goto done;
-
 		}
 		nresolved += n;
 		nvalid += nresolved;