diff --git a/lib/Epub/Epub/EpubHtmlParserSlim.cpp b/lib/Epub/Epub/EpubHtmlParserSlim.cpp
index a8951da..783384d 100644
--- a/lib/Epub/Epub/EpubHtmlParserSlim.cpp
+++ b/lib/Epub/Epub/EpubHtmlParserSlim.cpp
@@ -188,7 +188,7 @@ bool EpubHtmlParserSlim::parseAndBuildPages() {
FILE* file = fopen(filepath, "r");
do {
- void* const buf = XML_GetBuffer(parser, BUFSIZ);
+ void* const buf = XML_GetBuffer(parser, 1024);
if (!buf) {
Serial.println("Couldn't allocate memory for buffer");
XML_ParserFree(parser);
@@ -196,7 +196,7 @@ bool EpubHtmlParserSlim::parseAndBuildPages() {
return false;
}
- const size_t len = fread(buf, 1, BUFSIZ, file);
+ const size_t len = fread(buf, 1, 1024, file);
if (ferror(file)) {
Serial.println("Read error");
diff --git a/lib/Epub/Epub/EpubHtmlParserSlim.h b/lib/Epub/Epub/EpubHtmlParserSlim.h
index d6a7f71..ae42f3e 100644
--- a/lib/Epub/Epub/EpubHtmlParserSlim.h
+++ b/lib/Epub/Epub/EpubHtmlParserSlim.h
@@ -1,6 +1,6 @@
#pragma once
-#include
+#include
#include
#include
@@ -21,7 +21,7 @@ class EpubHtmlParserSlim {
int boldUntilDepth = INT_MAX;
int italicUntilDepth = INT_MAX;
// If we encounter words longer than this, but this is pretty large
- char partWordBuffer[PART_WORD_BUFFER_SIZE];
+ char partWordBuffer[PART_WORD_BUFFER_SIZE] = {};
int partWordBufferIndex = 0;
TextBlock* currentTextBlock = nullptr;
Page* currentPage = nullptr;