From: Adam Dickmeiss Date: Mon, 14 Apr 2003 16:52:10 +0000 (+0000) Subject: Fix another bug in lexer X-Git-Tag: YAZ.2.0.1~25 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=712de175de28e9977ead36d1cdd877993b008d09;p=yaz-moved-to-github.git Fix another bug in lexer --- diff --git a/cql/lexer.c b/cql/lexer.c index 495cc04..8ac8591 100644 --- a/cql/lexer.c +++ b/cql/lexer.c @@ -1,4 +1,4 @@ -/* $Id: lexer.c,v 1.3 2003-04-14 15:40:03 adam Exp $ +/* $Id: lexer.c,v 1.4 2003-04-14 16:52:10 adam Exp $ Copyright (C) 2002-2003 Index Data Aps @@ -9,7 +9,7 @@ See the file LICENSE. static void putb(YYSTYPE *lval, CQL_parser cp, int c) { - if (lval->len >= lval->size) + if (lval->len+1 >= lval->size) { char *nb = nmem_malloc(cp->nmem, (lval->size = lval->len * 2 + 20)); memcpy (nb, lval->buf, lval->len); @@ -30,7 +30,6 @@ int yylex(YYSTYPE *lval, void *vp) int c; lval->cql = 0; lval->rel = 0; - lval->rel = 0; lval->len = 0; lval->size = 10; lval->buf = nmem_malloc(cp->nmem, lval->size);