X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=dict%2Flookgrep.c;h=f480029246c1471b44d22817569a1f32f3358dbf;hb=refs%2Ftags%2Fv2.0.52;hp=eb917823d3d0845d4c1f7755b595720d4fa036c5;hpb=a89d8384ad975fdddb2aa56e8c27b689a5e23f96;p=idzebra-moved-to-github.git diff --git a/dict/lookgrep.c b/dict/lookgrep.c index eb91782..f480029 100644 --- a/dict/lookgrep.c +++ b/dict/lookgrep.c @@ -1,5 +1,5 @@ /* This file is part of the Zebra server. - Copyright (C) 1994-2009 Index Data + Copyright (C) 1994-2011 Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -19,6 +19,9 @@ +#if HAVE_CONFIG_H +#include +#endif #include #include #include @@ -409,7 +412,7 @@ int dict_lookup_grep(Dict dict, const char *pattern, int range, void *client, mc = mk_MatchContext(dfa, range); - Rj = (MatchWord *) xcalloc((MAX_LENGTH+1) * mc->n, sizeof(*Rj)); + Rj = (MatchWord *) xcalloc((MAX_LENGTH+2) * mc->fact, sizeof(*Rj)); set_bit (mc, Rj, 0, 0); for (d = 1; d<=mc->range; d++)