commit - 36e83e5eea8d1387c024006cc320e4ef9d545b16
commit + ea8d9c76cc8fdc1dacfcc1cb952769fcd0930b10
blob - 1cbce6b3ad5b6169b26f1ca72e58e3bb1bad9d7f
blob + 11ba3814d20b1e2326659222ac27df0feeb7f5d5
--- libexec/got-fetch-pack/got-fetch-pack.c
+++ libexec/got-fetch-pack/got-fetch-pack.c
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
}
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;