76 int last = lua_gettop(L); |
76 int last = lua_gettop(L); |
77 int i; |
77 int i; |
78 for(i = 2; i <= last; i++) { |
78 for(i = 2; i <= last; i++) { |
79 if(!lua_isstring(L, i) && !is_event_buffer(L, i)) |
79 if(!lua_isstring(L, i) && !is_event_buffer(L, i)) |
80 luaL_argerror(L, i, "Argument is not a string or buffer object"); |
80 luaL_argerror(L, i, "Argument is not a string or buffer object"); |
|
81 if(lua_equal(L, 1, i)) |
|
82 luaL_argerror(L, i, "Cannot add buffer to itself"); |
81 /* Optionally perform checks and data loading separately to avoid overfilling the buffer */ |
83 /* Optionally perform checks and data loading separately to avoid overfilling the buffer */ |
82 #if BUFFER_ADD_CHECK_INPUT_FIRST |
84 #if BUFFER_ADD_CHECK_INPUT_FIRST |
83 } |
85 } |
84 for(i = 2; i <= last; i++) { |
86 for(i = 2; i <= last; i++) { |
85 #endif |
87 #endif |