Skip to content

Commit db19998

Browse files
authored
bugfix: the format in argerror messages are incorrect (#1787)
lua_pushfstring() doesn't accept '%i' format. We should use '%d' instead.
1 parent 97b9189 commit db19998

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ngx_http_lua_socket_tcp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ ngx_http_lua_socket_tcp_connect(lua_State *L)
901901
pool_size = (ngx_int_t) lua_tointeger(L, -1);
902902

903903
if (pool_size <= 0) {
904-
msg = lua_pushfstring(L, "bad \"pool_size\" option value: %i",
904+
msg = lua_pushfstring(L, "bad \"pool_size\" option value: %d",
905905
pool_size);
906906
return luaL_argerror(L, n, msg);
907907
}
@@ -920,7 +920,7 @@ ngx_http_lua_socket_tcp_connect(lua_State *L)
920920
backlog = (ngx_int_t) lua_tointeger(L, -1);
921921

922922
if (backlog < 0) {
923-
msg = lua_pushfstring(L, "bad \"backlog\" option value: %i",
923+
msg = lua_pushfstring(L, "bad \"backlog\" option value: %d",
924924
backlog);
925925
return luaL_argerror(L, n, msg);
926926
}
@@ -5286,7 +5286,7 @@ ngx_http_lua_socket_tcp_setkeepalive(lua_State *L)
52865286
}
52875287

52885288
if (pool_size <= 0) {
5289-
msg = lua_pushfstring(L, "bad \"pool_size\" option value: %i",
5289+
msg = lua_pushfstring(L, "bad \"pool_size\" option value: %d",
52905290
pool_size);
52915291
return luaL_argerror(L, n, msg);
52925292
}

0 commit comments

Comments
 (0)