From 0f534597e60c9bb80227c3beb1d908dbac7267fc Mon Sep 17 00:00:00 2001 From: pennam Date: Thu, 12 Dec 2024 17:36:07 +0100 Subject: [PATCH] OTA: better (esp32) fix for sprintf warning --- src/ota/interface/OTAInterfaceDefault.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ota/interface/OTAInterfaceDefault.cpp b/src/ota/interface/OTAInterfaceDefault.cpp index 97cb8257..a641595b 100644 --- a/src/ota/interface/OTAInterfaceDefault.cpp +++ b/src/ota/interface/OTAInterfaceDefault.cpp @@ -161,7 +161,7 @@ OTACloudProcessInterface::State OTADefaultCloudProcessInterface::requestOta(OtaF if((mode & ChunkDownload) == ChunkDownload) { char range[128] = {0}; size_t rangeSize = context->downloadedSize + maxChunkSize > context->contentLength ? context->contentLength - context->downloadedSize : maxChunkSize; - sprintf(range, "bytes=%lu-%lu", context->downloadedSize, context->downloadedSize + rangeSize); + sprintf(range, "bytes=%" PRIu32 "-%" PRIu32, context->downloadedSize, context->downloadedSize + rangeSize); DEBUG_VERBOSE("OTA downloading range: %s", range); http_client->sendHeader("Range", range); }