From 946ae6ac9a523eece8c66005e90e9c827e585a65 Mon Sep 17 00:00:00 2001 From: Chen Peng Date: Thu, 9 Jul 2026 10:00:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AppKit/fifo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AppKit/fifo.c b/AppKit/fifo.c index 47b721b..bb6c94d 100644 --- a/AppKit/fifo.c +++ b/AppKit/fifo.c @@ -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;