diff options
| author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-07-26 05:17:37 +0000 |
|---|---|---|
| committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-07-26 05:17:37 +0000 |
| commit | 911e8d7e7f63e6e90814e82955bfaf26328afb19 (patch) | |
| tree | 575a916f4616a0f865bff9928faa9be67a8c867e /src/buffer.c | |
| parent | d914007507a6a4ad3489cca19652af403fef7074 (diff) | |
| download | luasocket-911e8d7e7f63e6e90814e82955bfaf26328afb19.tar.gz luasocket-911e8d7e7f63e6e90814e82955bfaf26328afb19.tar.bz2 luasocket-911e8d7e7f63e6e90814e82955bfaf26328afb19.zip | |
Beta2 is out! Total timeout works on Windows.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/buffer.c b/src/buffer.c index a696158..dbd5d2c 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -81,10 +81,10 @@ int buf_meth_send(lua_State *L, p_buf buf) { | |||
| 81 | const char *data = luaL_checklstring(L, 2, &size); | 81 | const char *data = luaL_checklstring(L, 2, &size); |
| 82 | long start = (long) luaL_optnumber(L, 3, 1); | 82 | long start = (long) luaL_optnumber(L, 3, 1); |
| 83 | long end = (long) luaL_optnumber(L, 4, -1); | 83 | long end = (long) luaL_optnumber(L, 4, -1); |
| 84 | if (start < 0) start = size+start+1; | 84 | if (start < 0) start = (long) (size+start+1); |
| 85 | if (end < 0) end = size+end+1; | 85 | if (end < 0) end = (long) (size+end+1); |
| 86 | if (start < 1) start = 1; | 86 | if (start < 1) start = (long) 1; |
| 87 | if (end > (long) size) end = size; | 87 | if (end > (long) size) end = (long) size; |
| 88 | if (start <= end) err = sendraw(buf, data+start-1, end-start+1, &sent); | 88 | if (start <= end) err = sendraw(buf, data+start-1, end-start+1, &sent); |
| 89 | /* check if there was an error */ | 89 | /* check if there was an error */ |
| 90 | if (err != IO_DONE) { | 90 | if (err != IO_DONE) { |
