diff options
-rw-r--r-- | src/lanes.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lanes.c b/src/lanes.c index 6c044d1..bab5244 100644 --- a/src/lanes.c +++ b/src/lanes.c | |||
@@ -279,9 +279,9 @@ LUAG_FUNC( linda_send) | |||
279 | 279 | ||
280 | luaL_argcheck( L, linda, 1, "expected a linda object!"); | 280 | luaL_argcheck( L, linda, 1, "expected a linda object!"); |
281 | 281 | ||
282 | if( lua_isnumber(L, 2)) | 282 | if( lua_type( L, 2) == LUA_TNUMBER) // we don't want to use lua_isnumber() because of autocoercion |
283 | { | 283 | { |
284 | timeout= SIGNAL_TIMEOUT_PREPARE( lua_tonumber(L,2) ); | 284 | timeout = SIGNAL_TIMEOUT_PREPARE( lua_tonumber( L,2)); |
285 | ++ key_i; | 285 | ++ key_i; |
286 | } | 286 | } |
287 | else if( lua_isnil( L, 2)) // alternate explicit "no timeout" by passing nil before the key | 287 | else if( lua_isnil( L, 2)) // alternate explicit "no timeout" by passing nil before the key |
@@ -418,7 +418,7 @@ LUAG_FUNC( linda_receive) | |||
418 | 418 | ||
419 | luaL_argcheck( L, linda, 1, "expected a linda object!"); | 419 | luaL_argcheck( L, linda, 1, "expected a linda object!"); |
420 | 420 | ||
421 | if( lua_isnumber( L, 2)) | 421 | if( lua_type( L, 2) == LUA_TNUMBER) // we don't want to use lua_isnumber() because of autocoercion |
422 | { | 422 | { |
423 | timeout = SIGNAL_TIMEOUT_PREPARE( lua_tonumber( L, 2)); | 423 | timeout = SIGNAL_TIMEOUT_PREPARE( lua_tonumber( L, 2)); |
424 | ++ key_i; | 424 | ++ key_i; |