From 1b19b98cf501a30d087f20bd9c7277af04dcfc09 Mon Sep 17 00:00:00 2001 From: yhirose Date: Tue, 25 Feb 2020 11:34:04 -0500 Subject: [PATCH] Fixed problem with dictinary --- peglib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/peglib.h b/peglib.h index 3ef0379..ea29db4 100644 --- a/peglib.h +++ b/peglib.h @@ -433,7 +433,7 @@ public: { auto done = false; size_t len = 1; - while (!done) { + while (!done && len <= text_len) { std::string s(text, len); auto it = dic_.find(s); if (it == dic_.end()) {