diff options
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c index 5f06fc1..3d48a09 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -125,7 +125,8 @@ int buffer_meth_receive(lua_State *L, p_buffer buf) { | |||
| 125 | /* ---- validation: must precede timeout_markstart() and any I/O ---- */ | 125 | /* ---- validation: must precede timeout_markstart() and any I/O ---- */ |
| 126 | if (numeric) { | 126 | if (numeric) { |
| 127 | double n = lua_tonumber(L, 2); | 127 | double n = lua_tonumber(L, 2); |
| 128 | luaL_argcheck(L, n >= 0, 2, "invalid receive pattern"); | 128 | luaL_argcheck(L, n >= 0 && n < (lua_Number) ((size_t) -1), 2, |
| 129 | "invalid receive pattern"); | ||
| 129 | wanted = (size_t) n; | 130 | wanted = (size_t) n; |
| 130 | } else { | 131 | } else { |
| 131 | const char *p = luaL_optstring(L, 2, "*l"); | 132 | const char *p = luaL_optstring(L, 2, "*l"); |
