diff options
| -rw-r--r-- | core/src/xmake/winreg/query.c | 4 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/import/lib/detect/find_program.lua | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/src/xmake/winreg/query.c b/core/src/xmake/winreg/query.c index 036d4a7c3..4d2732ae6 100644 --- a/core/src/xmake/winreg/query.c +++ b/core/src/xmake/winreg/query.c @@ -151,7 +151,7 @@ tb_int_t xm_winreg_query(lua_State* lua) } // make value buffer - value = (tb_char_t*)tb_malloc0(valuesize); + value = (tb_char_t*)tb_malloc0(valuesize + 1); tb_assert_and_check_break(value); // get value result @@ -183,7 +183,7 @@ tb_int_t xm_winreg_query(lua_State* lua) } // make value buffer - value = (tb_char_t*)tb_malloc0(valuesize); + value = (tb_char_t*)tb_malloc0(valuesize + 1); tb_assert_and_check_break(value); // get value result diff --git a/xmake/core/sandbox/modules/import/lib/detect/find_program.lua b/xmake/core/sandbox/modules/import/lib/detect/find_program.lua index 7ee0fb5a9..81fdc285b 100644 --- a/xmake/core/sandbox/modules/import/lib/detect/find_program.lua +++ b/xmake/core/sandbox/modules/import/lib/detect/find_program.lua @@ -80,11 +80,11 @@ function sandbox_lib_detect_find_program._find(name, pathes, check) -- get registry value local value, errors = winreg.query(regpath) if not value then - raise(errors) + utils.verror(errors) end -- file path not exists? attempt to parse path from `"path" xxx` - if not os.exists(value) then + if value and not os.exists(value) then value = value:match("\"(.-)\"") end |
