diff options
| author | ruki <[email protected]> | 2015-07-02 14:54:00 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-07-02 14:54:00 +0800 |
| commit | f69c00a7ddcb835fe52169fa9b7e097680fba5c1 (patch) | |
| tree | fdbe29e9037607dd09335a117c730cc3f07a04d1 /core/src/xmake | |
| parent | c6cc4e543cbfc3e23761ebb4cc0f825055928ed2 (diff) | |
update tbox and fix copy file bug
Diffstat (limited to 'core/src/xmake')
| -rwxr-xr-x | core/src/xmake/machine.c | 2 | ||||
| -rwxr-xr-x | core/src/xmake/os/setenv.c | 2 | ||||
| -rwxr-xr-x | core/src/xmake/path/translate.c | 3 |
3 files changed, 3 insertions, 4 deletions
diff --git a/core/src/xmake/machine.c b/core/src/xmake/machine.c index 0898f9807..7c53cbd20 100755 --- a/core/src/xmake/machine.c +++ b/core/src/xmake/machine.c @@ -251,7 +251,7 @@ xm_machine_ref_t xm_machine_init() // init host #if defined(TB_CONFIG_OS_WINDOWS) lua_pushstring(impl->lua, "windows"); -#elif defined(TB_CONFIG_OS_MAC) +#elif defined(TB_CONFIG_OS_MACOSX) lua_pushstring(impl->lua, "macosx"); #elif defined(TB_CONFIG_OS_LINUX) lua_pushstring(impl->lua, "linux"); diff --git a/core/src/xmake/os/setenv.c b/core/src/xmake/os/setenv.c index 1dcf125ce..13fb991e2 100755 --- a/core/src/xmake/os/setenv.c +++ b/core/src/xmake/os/setenv.c @@ -81,7 +81,7 @@ tb_int_t xm_os_setenv(lua_State* lua) tb_size_t size = tb_min(p - b, sizeof(data) - 1); // copy it - tb_strlcpy(data, b, size); + tb_strncpy(data, b, size); data[size] = '\0'; // have been not inserted? diff --git a/core/src/xmake/path/translate.c b/core/src/xmake/path/translate.c index 7b53662ea..e1a573032 100755 --- a/core/src/xmake/path/translate.c +++ b/core/src/xmake/path/translate.c @@ -46,8 +46,7 @@ tb_int_t xm_path_translate(lua_State* lua) // copy path tb_char_t data[TB_PATH_MAXN]; - tb_strlcpy(data, path, sizeof(data) - 1); - data[sizeof(data) - 1] = '\0'; + tb_strlcpy(data, path, sizeof(data)); // done path:translate() lua_pushstring(lua, tb_path_translate(data, 0, sizeof(data) - 1)? data : tb_null); |
