This commit is contained in:
2026-07-09 10:00:59 +08:00
parent e27272c36d
commit 946ae6ac9a
+3
View File
@@ -392,6 +392,9 @@ unsigned long fifo_strtoul(fifo_t* self, os_size_t* endptr /*从哪里开始转
// Returns the virtual index relative to tail where the match starts, or -1 if not found
os_size_t fifo_strstr(fifo_t *self, const char *search) {
if(self==NULL || search==NULL || search[0]=='\0') return FIFO_INVALID_POS;
os_size_t search_len = strlen(search);
os_size_t count = fifo_count(self);
if (search_len == 0 || count < search_len) return FIFO_INVALID_POS;