Skip to content

Commit

Permalink
OTA: better (esp32) fix for sprintf warning
Browse files Browse the repository at this point in the history
  • Loading branch information
pennam committed Dec 12, 2024
1 parent 8152c4b commit 0f53459
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ota/interface/OTAInterfaceDefault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 0f53459

Please sign in to comment.