[hackers] [libgrapheme] Explicitly pop the reader-limit in to_titlecase() || Laslo Hunhold

From: <git_AT_suckless.org>
Date: Sat, 8 Oct 2022 13:18:46 +0200 (CEST)

commit 657e9379807b215593e8c0706a51872b7870e8fe
Author: Laslo Hunhold <dev_AT_frign.de>
AuthorDate: Sat Oct 8 13:17:47 2022 +0200
Commit: Laslo Hunhold <dev_AT_frign.de>
CommitDate: Sat Oct 8 13:17:47 2022 +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_AT_frign.de>

diff --git a/src/case.c b/src/case.c
index 4d289fd..72c1d6b 100644
--- a/src/case.c
+++ b/src/case.c
_AT_@ -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 {
                         /*
Received on Sat Oct 08 2022 - 13:18:46 CEST

This archive was generated by hypermail 2.3.0 : Sat Oct 08 2022 - 13:24:37 CEST