Optimization and tweaks based on feedback from PR #1947

This commit is contained in:
Hans
2025-03-04 11:22:46 +01:00
committed by GitHub
parent 29a0dd7a90
commit 7fcd7830cb

View File

@@ -641,12 +641,10 @@ static int pickit5_open(PROGRAMMER *pgm, const char *port) {
pgm->fd.usb.eep = USBDEV_EVT_EP_READ_3;
const char *pgm_suffix = strchr(pgmid, '_')? strchr(pgmid, '_'): "";
char part_option[32] = {}; // 32 should be enough
char part_option[128] = {0};
if(partdesc)
snprintf(part_option, 31, "-p %s ", partdesc);
else
strcpy(part_option, "");
snprintf(part_option, sizeof(part_option), "-p %s ", partdesc);
// Use LIBHIDAPI to connect to SNAP/PICkit4 if present.
// For some reason, chances are smaller to get