comparison src/c/urweb.c @ 470:7cb418e9714f

Tree demo works
author Adam Chlipala <adamc@hcoop.net>
date Thu, 06 Nov 2008 18:49:38 -0500
parents 3f1b9231a37b
children 70ee90105fce
comparison
equal deleted inserted replaced
469:b393c2fc80f8 470:7cb418e9714f
172 int len = ctx->cleanup_back - ctx->cleanup, newLen; 172 int len = ctx->cleanup_back - ctx->cleanup, newLen;
173 if (len == 0) 173 if (len == 0)
174 newLen = 1; 174 newLen = 1;
175 else 175 else
176 newLen = len * 2; 176 newLen = len * 2;
177 ctx->cleanup = realloc(ctx->cleanup, newLen); 177 ctx->cleanup = realloc(ctx->cleanup, newLen * sizeof(cleanup));
178 ctx->cleanup_front = ctx->cleanup + len; 178 ctx->cleanup_front = ctx->cleanup + len;
179 ctx->cleanup_back = ctx->cleanup + newLen; 179 ctx->cleanup_back = ctx->cleanup + newLen;
180 } 180 }
181 181
182 ctx->cleanup_front->func = func; 182 ctx->cleanup_front->func = func;