summaryrefslogtreecommitdiffhomepage
path: root/libs/nixio/src/io.c
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2009-02-22 22:49:23 +0000
committerSteven Barth <steven@midlink.org>2009-02-22 22:49:23 +0000
commitd2b11117f26285186b711271d24733d35e0444a1 (patch)
tree7c08cbd29658d0f0a1331f12156f5ddc97570975 /libs/nixio/src/io.c
parentda6f427d818573f76dd50771f4d60ff693eb8fd9 (diff)
NIXIO: TLS-Support, bugfixes
Diffstat (limited to 'libs/nixio/src/io.c')
-rw-r--r--libs/nixio/src/io.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/nixio/src/io.c b/libs/nixio/src/io.c
index 58054b2eb3..b337461212 100644
--- a/libs/nixio/src/io.c
+++ b/libs/nixio/src/io.c
@@ -36,8 +36,8 @@ static int nixio_sock__sendto(lua_State *L, int to) {
socklen_t alen = 0;
if (to) {
- const char *address = luaL_checklstring(L, 2, NULL);
- uint16_t port = (uint16_t)luaL_checkinteger(L, 3);
+ const char *address = luaL_checklstring(L, 3, NULL);
+ uint16_t port = (uint16_t)luaL_checkinteger(L, 4);
struct sockaddr_storage addrstor;
addr = (struct sockaddr*)&addrstor;
if (sock->domain == AF_INET) {
@@ -65,7 +65,7 @@ static int nixio_sock__sendto(lua_State *L, int to) {
do {
sent = sendto(sock->fd, data, len, 0, addr, alen);
} while(sent == -1 && errno == EINTR);
- if (len >= 0) {
+ if (sent >= 0) {
lua_pushinteger(L, sent);
return 1;
} else {