Skip to content

Commit

Permalink
chore(*): bump ZenKit
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed Mar 9, 2024
1 parent 763e42f commit 4ee4438
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/Vfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "Internal.hh"

#include <cstring>

ZkVfs* ZkVfs_new(void) {
ZKC_TRACE_FN();
return new ZkVfs {};
Expand Down Expand Up @@ -101,7 +103,10 @@ ZkVfsNode* ZkVfsNode_newFile(ZkString name, ZkByte const* buf, ZkSize size, time
ZKC_CHECK_NULL(name, buf);

try {
auto node = ZkVfsNode::file(name, zenkit::VfsFileDescriptor {(std::byte const*) (buf), size}, ts);
std::byte* mem = new std::byte[size];
memcpy(mem, buf, size);

auto node = ZkVfsNode::file(name, zenkit::VfsFileDescriptor {mem, size, true}, ts);
return ZKC_WRAP_NEW(node);
} catch (std::exception const& exc) {
ZKC_LOG_ERROR("ZkVfsNode_newFile() failed: %s", exc.what());
Expand Down
2 changes: 1 addition & 1 deletion vendor/ZenKit
Submodule ZenKit updated 2 files
+7 −0 include/zenkit/Vfs.hh
+24 −2 src/Vfs.cc

0 comments on commit 4ee4438

Please sign in to comment.