From f23bcb8a470968ed0a9744c496280bd28dba7e37 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Wed, 5 Feb 2014 20:13:52 +0000 Subject: [PATCH] bugfix in the recognizer for literals in the C runtime --- src/runtime/c/pgf/literals.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runtime/c/pgf/literals.c b/src/runtime/c/pgf/literals.c index 2043dd24c..89ddfdaf2 100644 --- a/src/runtime/c/pgf/literals.c +++ b/src/runtime/c/pgf/literals.c @@ -19,7 +19,7 @@ pgf_match_string_lit(PgfConcr* concr, PgfSymbol* psym, size_t lin_idx, gu_assert(lin_idx == 0); size_t offset = *poffset; - while (!gu_is_space(sentence[offset])) + while (sentence[offset] && !gu_is_space(sentence[offset])) offset++; size_t len = offset - *poffset; @@ -61,7 +61,7 @@ pgf_match_int_lit(PgfConcr* concr, PgfSymbol* psym, size_t lin_idx, gu_assert(lin_idx == 0); size_t offset = *poffset; - while (!gu_is_space(sentence[offset])) + while (sentence[offset] && !gu_is_space(sentence[offset])) offset++; size_t len = offset - *poffset; @@ -108,7 +108,7 @@ pgf_match_float_lit(PgfConcr* concr, PgfSymbol* psym, size_t lin_idx, gu_assert(lin_idx == 0); size_t offset = *poffset; - while (!gu_is_space(sentence[offset])) + while (sentence[offset] && !gu_is_space(sentence[offset])) offset++; size_t len = offset - *poffset;