diff util-src/ringbuffer.c @ 14176:2bcabbeac9b0 13.0

util.ringbuffer: Fix incorrect returned position from :find() for #needle~=1 And add a test for :find()
author Matthew Wild <mwild1@gmail.com>
date Mon, 25 May 2026 14:41:06 +0100
parents a187600ec7d6
children 67b68147ed1d
line wrap: on
line diff
--- a/util-src/ringbuffer.c	Mon May 25 13:29:28 2026 +0100
+++ b/util-src/ringbuffer.c	Mon May 25 14:41:06 2026 +0100
@@ -99,7 +99,7 @@
 				}
 
 			if(m) {
-				return i + l;
+				return i + 1;
 			}
 		}
 	}