commit 657e9379807b215593e8c0706a51872b7870e8fe
parent a1913f83b643e883aa6754d8078aee7d46f53aec
Author: Laslo Hunhold <dev@frign.de>
Date: Sat, 8 Oct 2022 13:17:47 +0200
Explicitly pop the reader-limit in to_titlecase()
This ensures that we don't have any stray limits on the stack and
always have a clean state.
Signed-off-by: Laslo Hunhold <dev@frign.de>
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/case.c b/src/case.c
@@ -185,12 +185,14 @@ to_titlecase(HERODOTUS_READER *r, HERODOTUS_WRITER *w)
if (s == HERODOTUS_STATUS_END_OF_BUFFER) {
/* we are done */
+ herodotus_reader_pop_limit(r);
break;
} else if (s == HERODOTUS_STATUS_SOFT_LIMIT_REACHED) {
/*
* we did not encounter any cased character
* up to the word break
*/
+ herodotus_reader_pop_limit(r);
continue;
} else {
/*