Fix format specifiers in main.c for uint32_t values

Add inttypes.h include and use PRIu32 for cfg.interval and cfg.time
to fix format warnings being treated as errors
This commit is contained in:
Bob 2025-11-09 02:41:42 +00:00
parent ed77cfe86f
commit 1af64e0341
1 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <inttypes.h>
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/task.h" #include "freertos/task.h"
#include "freertos/event_groups.h" #include "freertos/event_groups.h"
@ -256,7 +257,7 @@ static int cmd_iperf(int argc, char **argv)
cfg.bw_lim = iperf_args.bw->ival[0]; cfg.bw_lim = iperf_args.bw->ival[0];
} }
ESP_LOGI(TAG, "mode=%s-%s sport=%u, dip=%u.%u.%u.%u:%u, interval=%u, time=%u", ESP_LOGI(TAG, "mode=%s-%s sport=%u, dip=%u.%u.%u.%u:%u, interval=%" PRIu32 ", time=%" PRIu32,
(cfg.flag & IPERF_FLAG_TCP) ? "tcp" : "udp", (cfg.flag & IPERF_FLAG_TCP) ? "tcp" : "udp",
(cfg.flag & IPERF_FLAG_SERVER) ? "server" : "client", (cfg.flag & IPERF_FLAG_SERVER) ? "server" : "client",
cfg.sport, cfg.sport,