Skip to content

Commit 3d1dad7

Browse files
authored
Fix x86-32 compile warning and update document (#1164)
1 parent ceaf7dc commit 3d1dad7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

core/iwasm/compilation/aot_emit_aot_file.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,8 +2103,10 @@ aot_resolve_target_info(AOTCompContext *comp_ctx, AOTObjectData *obj_data)
21032103
return false;
21042104
}
21052105

2106-
strncpy(obj_data->target_info.arch, comp_ctx->target_arch,
2107-
sizeof(obj_data->target_info.arch) - 1);
2106+
bh_assert(sizeof(obj_data->target_info.arch)
2107+
== sizeof(comp_ctx->target_arch));
2108+
bh_memcpy_s(obj_data->target_info.arch, sizeof(obj_data->target_info.arch),
2109+
comp_ctx->target_arch, sizeof(comp_ctx->target_arch));
21082110

21092111
return true;
21102112
}

doc/wamr_api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Below is the reference implementation of the pub application. It utilizes a time
107107

108108
``` C
109109
/* Timer callback */
110-
void timer_update(user_timer_t timer
110+
void timer_update(user_timer_t timer)
111111
{
112112
attr_container_t *event;
113113

0 commit comments

Comments
 (0)