summaryrefslogtreecommitdiffstats
path: root/src/tokenizers/tokenizers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tokenizers/tokenizers.c')
-rw-r--r--src/tokenizers/tokenizers.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tokenizers/tokenizers.c b/src/tokenizers/tokenizers.c
index f0481e00d..6c92f9a97 100644
--- a/src/tokenizers/tokenizers.c
+++ b/src/tokenizers/tokenizers.c
@@ -60,13 +60,15 @@ get_next_word (f_str_t *buf, f_str_t *token)
pos = token->begin;
/* Skip non graph symbols */
- while (remain-- && !g_ascii_isgraph (*pos)) {
+ while (remain > 0 && !g_ascii_isgraph (*pos)) {
token->begin ++;
pos ++;
+ remain --;
}
- while (remain-- && g_ascii_isgraph (*pos)) {
+ while (remain > 0 && g_ascii_isgraph (*pos)) {
token->len ++;
pos ++;
+ remain --;
}
if (token->len == 0) {