mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2025-12-18 23:27:44 +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");
|
FILE* file = fopen(filepath, "r");
|
||||||
|
|
||||||
do {
|
do {
|
||||||
void* const buf = XML_GetBuffer(parser, BUFSIZ);
|
void* const buf = XML_GetBuffer(parser, 1024);
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
Serial.println("Couldn't allocate memory for buffer");
|
Serial.println("Couldn't allocate memory for buffer");
|
||||||
XML_ParserFree(parser);
|
XML_ParserFree(parser);
|
||||||
@ -196,7 +196,7 @@ bool EpubHtmlParserSlim::parseAndBuildPages() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const size_t len = fread(buf, 1, BUFSIZ, file);
|
const size_t len = fread(buf, 1, 1024, file);
|
||||||
|
|
||||||
if (ferror(file)) {
|
if (ferror(file)) {
|
||||||
Serial.println("Read error");
|
Serial.println("Read error");
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <expat_external.h>
|
#include <expat.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@ -21,7 +21,7 @@ class EpubHtmlParserSlim {
|
|||||||
int boldUntilDepth = INT_MAX;
|
int boldUntilDepth = INT_MAX;
|
||||||
int italicUntilDepth = INT_MAX;
|
int italicUntilDepth = INT_MAX;
|
||||||
// If we encounter words longer than this, but this is pretty large
|
// 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;
|
int partWordBufferIndex = 0;
|
||||||
TextBlock* currentTextBlock = nullptr;
|
TextBlock* currentTextBlock = nullptr;
|
||||||
Page* currentPage = nullptr;
|
Page* currentPage = nullptr;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user