mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2025-12-18 15:17:42 +03:00
Increase EpubHtmlParserSlim file buffer to 1024 bytes
This commit is contained in:
parent
a33ac25dca
commit
74f7ea9650
@ -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");
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <expat_external.h>
|
||||
#include <expat.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include <functional>
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user