diff --git a/core/iwasm/compilation/aot_emit_aot_file.c b/core/iwasm/compilation/aot_emit_aot_file.c index f81a724b..dacb59c6 100644 --- a/core/iwasm/compilation/aot_emit_aot_file.c +++ b/core/iwasm/compilation/aot_emit_aot_file.c @@ -2103,8 +2103,10 @@ aot_resolve_target_info(AOTCompContext *comp_ctx, AOTObjectData *obj_data) return false; } - strncpy(obj_data->target_info.arch, comp_ctx->target_arch, - sizeof(obj_data->target_info.arch) - 1); + bh_assert(sizeof(obj_data->target_info.arch) + == sizeof(comp_ctx->target_arch)); + bh_memcpy_s(obj_data->target_info.arch, sizeof(obj_data->target_info.arch), + comp_ctx->target_arch, sizeof(comp_ctx->target_arch)); return true; } diff --git a/doc/wamr_api.md b/doc/wamr_api.md index 5790fd13..3eff8692 100644 --- a/doc/wamr_api.md +++ b/doc/wamr_api.md @@ -107,7 +107,7 @@ Below is the reference implementation of the pub application. It utilizes a time ``` C /* Timer callback */ -void timer_update(user_timer_t timer +void timer_update(user_timer_t timer) { attr_container_t *event;