Replace pm3_max_cmd_data_size() by g_conn.max_cmd_data_size

This commit is contained in:
Philippe Teuwen committed 2026-09-01 17:58:14 +02:00
1 parent b69fa20233
commit 0cde2124c8
20 files changed
+60 -65

No files matched your search

+3 -3
View File
@@ -1139,7 +1139,7 @@ static int download_trace(void) {
gs_traceLen = 0;
gs_trace = calloc(pm3_max_cmd_data_size(), sizeof(uint8_t));
gs_trace = calloc(g_conn.max_cmd_data_size, sizeof(uint8_t));
if (gs_trace == NULL) {
PrintAndLogEx(WARNING, "Failed to allocate memory");
return PM3_EMALLOC;
@@ -1149,7 +1149,7 @@ static int download_trace(void) {
// Query for the size of the trace, downloading PM3_CMD_DATA_SIZE
PacketResponseNG resp;
if (!GetFromDevice(BIG_BUF, gs_trace, pm3_max_cmd_data_size(), 0, NULL, 0, &resp, 4000, true)) {
if (!GetFromDevice(BIG_BUF, gs_trace, g_conn.max_cmd_data_size, 0, NULL, 0, &resp, 4000, true)) {
PrintAndLogEx(WARNING, "timeout while waiting for reply");
free(gs_trace);
gs_trace = NULL;
@@ -1166,7 +1166,7 @@ static int download_trace(void) {
gs_traceLen = ((const download_done_t *)resp.data.asBytes)->extra;
// if tracelog buffer was larger and we need to download more.
if (gs_traceLen > pm3_max_cmd_data_size()) {
if (gs_traceLen > g_conn.max_cmd_data_size) {
free(gs_trace);
gs_trace = calloc(gs_traceLen, sizeof(uint8_t));