Skip to content

Commit 190651b

Browse files
authored
wasip2: Adjust error code on invalid utf-8 (WebAssembly#665)
Use `EILSEQ` instead of `ENOENT` to match behavior of WASIp1.
1 parent 042b2bc commit 190651b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libc-bottom-half/sources/wasip2_file_utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static int validate_utf8(const char *ptr_signed) {
7474
int wasip2_string_from_c(const char *s, wasip2_string_t *out) {
7575
int len = validate_utf8(s);
7676
if (len < 0) {
77-
errno = ENOENT;
77+
errno = EILSEQ;
7878
return -1;
7979
}
8080
out->ptr = (uint8_t*) s;

0 commit comments

Comments
 (0)