X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=judge%2Fjudge-shuff.c;h=99df3d5cb188bdd5a00815e975a574f66f38fdbd;hb=32a38f82fff9cf1098f68a2b9ada9f9e0f98fdd6;hp=fe6933ef81683329852c9ee4777402d2c3ba3a0d;hpb=ec9a3b79df652797293110406ad6d17829e0c09b;p=eval.git diff --git a/judge/judge-shuff.c b/judge/judge-shuff.c index fe6933e..99df3d5 100644 --- a/judge/judge-shuff.c +++ b/judge/judge-shuff.c @@ -34,7 +34,7 @@ struct tokbuf { char *read_pos; }; -#define TOKBUF_PAGE 256 +#define TOKBUF_PAGE 65536 static void init_tokbuf(struct tokbuf *tb) { @@ -47,6 +47,8 @@ static void add_token(struct tokbuf *tb, char *token, int l) struct tokpage *pg = tb->last_page; if (!pg || pg->end - pg->pos < l) { + if (pg) + pg->end = pg->pos; int size = TOKBUF_PAGE - sizeof(struct tokbuf); if (l > size/5) size = l;