Merge branch 'snprintf' into snprintfPR

# Conflicts:
#	src/driver/drv_bl_shared.c
This commit is contained in:
btsimonh
2022-10-25 06:29:59 +01:00
15 changed files with 47 additions and 47 deletions

View File

@ -199,9 +199,9 @@ void http_html_end(http_request_t* request) {
WiFI_GetMacAddress((char*)mac);
sprintf(upTimeStr, "<br>Device MAC: %02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
snprintf(upTimeStr, sizeof(upTimeStr), "<br>Device MAC: %02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
poststr(request, upTimeStr);
sprintf(upTimeStr, "<br>Short name: %s, Chipset %s", CFG_GetShortDeviceName(), PLATFORM_MCU_NAME);
snprintf(upTimeStr, sizeof(upTimeStr), "<br>Short name: %s, Chipset %s", CFG_GetShortDeviceName(), PLATFORM_MCU_NAME);
poststr(request, upTimeStr);
poststr(request, htmlBodyEnd);

View File

@ -698,7 +698,7 @@ static int http_rest_post_logconfig(http_request_t* request) {
else {
ADDLOG_ERROR(LOG_FEATURE_API, "Unexpected key: %.*s", t[i].end - t[i].start,
json_str + t[i].start);
sprintf(tmp, "Unexpected key: %.*s\n", t[i].end - t[i].start,
snprintf(tmp, sizeof(tmp), "Unexpected key: %.*s\n", t[i].end - t[i].start,
json_str + t[i].start);
poststr(request, tmp);
}