Skip to content

Commit

Permalink
fix localalloc typo
Browse files Browse the repository at this point in the history
  • Loading branch information
KnicKnic committed Dec 27, 2019
1 parent 6178a02 commit d12acfb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions pkg/powershell/chelpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func mallocCopyArrayGenericPowerShellObject(input []nativePowerShell_GenericPowe

inputCount := uint64(len(input))

var size uint64
var size uint64 = 0
if inputCount != 0 {
size = inputCount * uint64(unsafe.Sizeof(input[0]))
}
Expand All @@ -51,7 +51,9 @@ func mallocCopyArrayGenericPowerShellObject(input []nativePowerShell_GenericPowe
panic("Couldn't allocate memory")
}

_ = memcpyGenericPowerShellObject(data, &input[0], size)
if inputCount != 0 {
_ = memcpyGenericPowerShellObject(data, &input[0], size)
}

return data
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/powershell/zpsh_host.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d12acfb

Please sign in to comment.