Skip to content

Commit

Permalink
TEMPORARY FIX: some functions don't set the length arg
Browse files Browse the repository at this point in the history
For example, `GLib.Bytes.getData`. This needs to be investigated
  • Loading branch information
vixalien committed Jan 26, 2024
1 parent a63da10 commit f76b398
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/types/argument/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ export function unboxArray(type, array, length = -1) {
let buffer;

// manually get the length of the array
if (length === -1) {
// TODO: investigate why some methods don't set the size data (it's kept to 0)
if (length === -1 || length === 0n) {
let i = 0;
while (getArrayElement(pointer, paramTag, i) !== 0) i++;

Expand Down

0 comments on commit f76b398

Please sign in to comment.