diff --git a/core/src/dap_time.c b/core/src/dap_time.c index 7f708ff9fa8ad2545a5daf05942769b8314116cb..9da1a2b210774ea280bf262eef6267a7022cbbf0 100644 --- a/core/src/dap_time.c +++ b/core/src/dap_time.c @@ -153,11 +153,12 @@ int dap_time_to_str_rfc822(char *a_out, size_t a_out_size_max, dap_time_t a_time // %z is unsupported on Windows platform TIME_ZONE_INFORMATION l_tz_info; GetTimeZoneInformation(&l_tz_info); - char l_tz_str[8] = { '\0' }; + char l_tz_str[8]; snprintf(l_tz_str, sizeof(l_tz_str), " +%02d%02d", -(l_tz_info.Bias / 60), l_tz_info.Bias % 60); if (l_ret < a_out_size_max) l_ret += snprintf(a_out + l_ret, a_out_size_max - l_ret, l_tz_str); #endif + a_out[l_ret] = '\0'; return l_ret; } diff --git a/net/server/http_server/http_client/dap_http_client.c b/net/server/http_server/http_client/dap_http_client.c index a0f330ae7b968108c5e77a5cdc479b21a5142950..4ffea5bc70f52437bfbc57ba35423df2453140e1 100644 --- a/net/server/http_server/http_client/dap_http_client.c +++ b/net/server/http_server/http_client/dap_http_client.c @@ -553,8 +553,8 @@ void dap_http_client_write(dap_http_client_t *a_http_client) a_http_client->reply_status_code, a_http_client->reply_reason_phrase[0] ? a_http_client->reply_reason_phrase : http_status_reason_phrase(a_http_client->reply_status_code) ); /* Write HTTP headres */ - char l_buf[32]; - dap_time_to_str_rfc822( l_buf, sizeof(l_buf) - 1, time( NULL ) ); + char l_buf[DAP_TIME_STR_SIZE]; + dap_time_to_str_rfc822( l_buf, DAP_TIME_STR_SIZE, time( NULL ) ); dap_http_header_add( &a_http_client->out_headers, "Date", l_buf ); for ( dap_http_header_t *hdr = a_http_client->out_headers; hdr; hdr = a_http_client->out_headers ) { diff --git a/net/server/json_rpc/rpc_core/src/dap_json_rpc_params.c b/net/server/json_rpc/rpc_core/src/dap_json_rpc_params.c index 65ceeaf436b54e7a73d9ff6d230d348b243ed351..09059eb900edee63eae90218c64f66ea3f284afb 100644 --- a/net/server/json_rpc/rpc_core/src/dap_json_rpc_params.c +++ b/net/server/json_rpc/rpc_core/src/dap_json_rpc_params.c @@ -53,6 +53,7 @@ void dap_json_rpc_params_add_param(dap_json_rpc_params_t *a_params, dap_json_rpc { dap_json_rpc_param_t **new_params = DAP_REALLOC_COUNT_RET_IF_FAIL(a_params->params, a_params->length + 1); new_params[a_params->length] = a_param; + a_params->params = new_params; ++a_params->length; }