Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/facebook/luaffifb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2015-08-17 22:41:16 +0300
committerSam Gross <colesbury@gmail.com>2015-08-17 22:41:16 +0300
commit390fccc747b54288bfb287f55cb1b764735e281d (patch)
treef6225531820a33ba987e1529996f376f0d853026
parent82912f3127f1ad5559d6be753a77830195a1c4a0 (diff)
Fix compiler warning
-rw-r--r--ffi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ffi.c b/ffi.c
index 4d1e140..f86d3be 100644
--- a/ffi.c
+++ b/ffi.c
@@ -2632,9 +2632,11 @@ static int ffi_string(lua_State* L)
size_t sz;
if (lua_isuserdata(L, 2)) {
- if (!cdata_tointeger(L, 2, &sz)) {
+ ptrdiff_t val;
+ if (!cdata_tointeger(L, 2, &val)) {
type_error(L, 2, "int", 0, NULL);
}
+ sz = (size_t) val;
} else if (!lua_isnil(L, 2)) {
sz = (size_t) luaL_checknumber(L, 2);