aboutsummaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 4260f20..2938b52 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -67,7 +67,7 @@ int buf_send(lua_State *L, p_buf buf)
67 tm_markstart(&base->base_tm); 67 tm_markstart(&base->base_tm);
68 for (arg = 2; arg <= top; arg++) { /* first arg is socket object */ 68 for (arg = 2; arg <= top; arg++) { /* first arg is socket object */
69 size_t done, len; 69 size_t done, len;
70 cchar *data = luaL_opt_lstr(L, arg, NULL, &len); 70 cchar *data = luaL_optlstring(L, arg, NULL, &len);
71 if (!data || err != PRIV_DONE) break; 71 if (!data || err != PRIV_DONE) break;
72 err = sendraw(L, buf, data, len, &done); 72 err = sendraw(L, buf, data, len, &done);
73 total += done; 73 total += done;
@@ -111,12 +111,12 @@ int buf_receive(lua_State *L, p_buf buf)
111 top++; 111 top++;
112 } 112 }
113 /* make sure we have enough stack space */ 113 /* make sure we have enough stack space */
114 luaL_check_stack(L, top+LUA_MINSTACK, "too many arguments"); 114 luaL_checkstack(L, top+LUA_MINSTACK, "too many arguments");
115 /* receive all patterns */ 115 /* receive all patterns */
116 for (arg = 2; arg <= top && err == PRIV_DONE; arg++) { 116 for (arg = 2; arg <= top && err == PRIV_DONE; arg++) {
117 if (!lua_isnumber(L, arg)) { 117 if (!lua_isnumber(L, arg)) {
118 static cchar *patternnames[] = {"*l", "*lu", "*a", "*w", NULL}; 118 static cchar *patternnames[] = {"*l", "*lu", "*a", "*w", NULL};
119 cchar *pattern = luaL_opt_string(L, arg, NULL); 119 cchar *pattern = luaL_optstring(L, arg, NULL);
120 /* get next pattern */ 120 /* get next pattern */
121 switch (luaL_findstring(pattern, patternnames)) { 121 switch (luaL_findstring(pattern, patternnames)) {
122 case 0: /* DOS line pattern */ 122 case 0: /* DOS line pattern */
@@ -126,10 +126,10 @@ int buf_receive(lua_State *L, p_buf buf)
126 case 2: /* Until closed pattern */ 126 case 2: /* Until closed pattern */
127 err = recvall(L, buf); break; 127 err = recvall(L, buf); break;
128 case 3: /* Word pattern */ 128 case 3: /* Word pattern */
129 luaL_arg_check(L, 0, arg, "word patterns are deprecated"); 129 luaL_argcheck(L, 0, arg, "word patterns are deprecated");
130 break; 130 break;
131 default: /* else it is an error */ 131 default: /* else it is an error */
132 luaL_arg_check(L, 0, arg, "invalid receive pattern"); 132 luaL_argcheck(L, 0, arg, "invalid receive pattern");
133 break; 133 break;
134 } 134 }
135 /* raw pattern */ 135 /* raw pattern */