Skip to content

Commit

Permalink
Merge pull request #489 from savi-lang/fix/ffi-strlen-decl
Browse files Browse the repository at this point in the history
Fix underlying declaration of `_FFI.strlen` to use the correct return type.
  • Loading branch information
jemc committed Aug 14, 2024
2 parents f8f1944 + 409c0af commit cb6cb71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/Env.savi
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
i = USize[0]
while argc > 0 (
arg = argv._get_at(i)
len = _FFI.strlen(arg).usize
len = _FFI.strlen(arg)
@args.push(String.val_from_cpointer(arg, len, len))
argc -= 1
i += 1
Expand All @@ -52,7 +52,7 @@
break if arg.is_null

try (
len = _FFI.strlen(arg).usize
len = _FFI.strlen(arg)
pair = String.val_from_cpointer(arg, len, len).split2!('=')
@_vars.push(pair)
)
Expand Down
2 changes: 1 addition & 1 deletion core/_FFI.savi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:module _FFI
:ffi puts(string CPointer(U8)) I32
:ffi strlen(string CPointer(U8)) I32
:ffi strlen(string CPointer(U8)) USize
:ffi memset(pointer CPointer(U8), char I32, count USize) None
:ffi variadic snprintf(buffer CPointer(U8), buffer_size I32, fmt CPointer(U8)) I32

Expand Down

0 comments on commit cb6cb71

Please sign in to comment.