util-src/ringbuffer.c
changeset 10957 c3b3ac63f4c3
parent 10925 6eb5d2bb11af
child 12579 1f6f05a98fcd
--- a/util-src/ringbuffer.c	Tue Jun 23 17:59:24 2020 +0200
+++ b/util-src/ringbuffer.c	Wed Jun 24 12:34:20 2020 +0100
@@ -262,15 +262,15 @@
 	if(calc_splice_positions(b, start, end, &wrapped_start, &wrapped_end)) {
 		if(wrapped_end <= wrapped_start) {
 			for(i = wrapped_start; i < (long)b->alen; i++) {
-				lua_pushinteger(L, b->buffer[i]);
+				lua_pushinteger(L, (unsigned char)b->buffer[i]);
 			}
 			for(i = 0; i < wrapped_end; i++) {
-				lua_pushinteger(L, b->buffer[i]);
+				lua_pushinteger(L, (unsigned char)b->buffer[i]);
 			}
 			return wrapped_end + (b->alen - wrapped_start);
 		} else {
 			for(i = wrapped_start; i < wrapped_end; i++) {
-				lua_pushinteger(L, b->buffer[i]);
+				lua_pushinteger(L, (unsigned char)b->buffer[i]);
 			}
 			return wrapped_end - wrapped_start;
 		}