summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-03-08 10:08:39 +0100
committerJo-Philipp Wich <jo@mein.io>2021-03-08 19:18:58 +0100
commita6c69b18cbf19dc43092b0ae23758a83471357a8 (patch)
tree20c8ac5a18494171e2850d6a4bf733446f4c7f18 /lib
parent160b971f6cf9e2b92eb07b8e6a56e3d5a99dc9ea (diff)
fs: fix readlink() return value
The fs.readlink() function incorrectly produced a JSON string containing trailing null bytes. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lib')
-rw-r--r--lib/fs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/fs.c b/lib/fs.c
index c6066cc..a784b23 100644
--- a/lib/fs.c
+++ b/lib/fs.c
@@ -442,7 +442,7 @@ uc_fs_readlink(uc_vm *vm, size_t nargs)
}
while (true);
- res = json_object_new_string_len(buf, buflen);
+ res = json_object_new_string_len(buf, rv);
free(buf);