Skip to content

platform: error: fix bogus usage of memset() #8036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions platform/mbed_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static mbed_error_status_t handle_error(mbed_error_status_t error_status, unsign
error_count++;

//Clear the context capturing buffer
memset(&current_error_ctx, sizeof(mbed_error_ctx), 0);
memset(&current_error_ctx, 0, sizeof(mbed_error_ctx));
//Capture error information
current_error_ctx.error_status = error_status;
current_error_ctx.error_address = (uint32_t)caller;
Expand Down Expand Up @@ -279,7 +279,7 @@ mbed_error_status_t mbed_clear_all_errors(void)
//Make sure we dont multiple clients resetting
core_util_critical_section_enter();
//Clear the error and context capturing buffer
memset(&last_error_ctx, sizeof(mbed_error_ctx), 0);
memset(&last_error_ctx, 0, sizeof(mbed_error_ctx));
//reset error count to 0
error_count = 0;
#if MBED_CONF_PLATFORM_ERROR_HIST_ENABLED
Expand Down