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;