Skip to content

Commit 9506f50

Browse files
authored
Merge pull request #8036 from TeroJaasko/fix_mbed_error_c_memsets
platform: error: fix bogus usage of memset()
2 parents 7bec04c + 321548c commit 9506f50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

platform/mbed_error.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static mbed_error_status_t handle_error(mbed_error_status_t error_status, unsign
120120
error_count++;
121121

122122
//Clear the context capturing buffer
123-
memset(&current_error_ctx, sizeof(mbed_error_ctx), 0);
123+
memset(&current_error_ctx, 0, sizeof(mbed_error_ctx));
124124
//Capture error information
125125
current_error_ctx.error_status = error_status;
126126
current_error_ctx.error_address = (uint32_t)caller;
@@ -279,7 +279,7 @@ mbed_error_status_t mbed_clear_all_errors(void)
279279
//Make sure we dont multiple clients resetting
280280
core_util_critical_section_enter();
281281
//Clear the error and context capturing buffer
282-
memset(&last_error_ctx, sizeof(mbed_error_ctx), 0);
282+
memset(&last_error_ctx, 0, sizeof(mbed_error_ctx));
283283
//reset error count to 0
284284
error_count = 0;
285285
#if MBED_CONF_PLATFORM_ERROR_HIST_ENABLED

0 commit comments

Comments
 (0)