From c8a2332ed3f1771243ac063edd3803b7cc2642b9 Mon Sep 17 00:00:00 2001 From: jpirnay Date: Sat, 25 Apr 2026 11:14:21 +0200 Subject: [PATCH] Add recommendation --- lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp b/lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp index 5b2ba0ab..d51936e6 100644 --- a/lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp +++ b/lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp @@ -1381,9 +1381,8 @@ bool ChapterHtmlSlimParser::setup(const size_t totalInflatedSize) { size_t ChapterHtmlSlimParser::write(const uint8_t data) { return write(&data, 1); } size_t ChapterHtmlSlimParser::write(const uint8_t* buffer, const size_t size) { - if (!activeParser || streamFailed || size == 0) { - return streamFailed ? 0 : size; - } + if (size == 0) return 0; + if (!activeParser || streamFailed) return 0; size_t remaining = size; const uint8_t* cursor = buffer;