event_buffer:add learned not to append to itself...

Fri, 07 Sep 2007 00:17:08 -0400

author
Thomas Harning Jr <harningt@gmail.com>
date
Fri, 07 Sep 2007 00:17:08 -0400
changeset 32
22976b4e5ffd
parent 31
1956a957c613
child 33
0d750f302d66

event_buffer:add learned not to append to itself...

src/event_buffer.c file | annotate | diff | comparison | revisions
--- a/src/event_buffer.c	Fri Sep 07 00:10:08 2007 -0400
+++ b/src/event_buffer.c	Fri Sep 07 00:17:08 2007 -0400
@@ -78,6 +78,8 @@
 	for(i = 2; i <= last; i++) {
 		if(!lua_isstring(L, i) && !is_event_buffer(L, i))
 			luaL_argerror(L, i, "Argument is not a string or buffer object");
+		if(lua_equal(L, 1, i))
+			luaL_argerror(L, i, "Cannot add buffer to itself");
 /* Optionally perform checks and data loading separately to avoid overfilling the buffer */
 #if BUFFER_ADD_CHECK_INPUT_FIRST
 	}

mercurial