graph: fix for missing allocation

resizing graph widgets (by setting the width parameter) was failing to
update the caches draw_to and draw_from.  I have attached a 2-line patch
remedying this.  The bug wasn't caught earlier because the default size,
80, is bigger than what people typically use.

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Matus Telgarsky 2009-04-14 19:36:37 -07:00 committed by Julien Danjou
parent 27c80c1950
commit 1c147a6d76
1 changed files with 2 additions and 0 deletions

View File

@ -510,6 +510,8 @@ luaA_graph_newindex(lua_State *L, awesome_token_t token)
{ {
d->width = width; d->width = width;
d->size = d->width - 2; d->size = d->width - 2;
p_realloc(&d->draw_from, d->size);
p_realloc(&d->draw_to, d->size);
for(int i = 0; i < d->plots.len; i++) for(int i = 0; i < d->plots.len; i++)
{ {
plot_t *plot = &d->plots.tab[i]; plot_t *plot = &d->plots.tab[i];