X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=hacks%2Fvermiculate.c;h=d1ef57198af245212cfc971fa17e2c4998507e67;hb=ff35d056d723c9a5ffe728dbba5f1c25e141be04;hp=6387a42a4909d38c05ea00b11cead074e8186996;hpb=c1b9b55ad8d59dc05ef55e316aebf5863e7dfa56;p=xscreensaver diff --git a/hacks/vermiculate.c b/hacks/vermiculate.c index 6387a42a..d1ef5719 100644 --- a/hacks/vermiculate.c +++ b/hacks/vermiculate.c @@ -264,7 +264,7 @@ bordupdate (struct state *st) for (x = xmin; x <= xmax; x++) sp (st, x, ybord, st->bordcol); for (y = ymin; y <= ymax; y++) - sp (st, ybord, y, st->bordcol); + sp (st, xbord, y, st->bordcol); } } @@ -795,7 +795,7 @@ vermiculate_init (Display *d, Window w) st->mygc = XCreateGC (st->dpy, st->window, 0, &mygcv); } - st->point = (unsigned char *) malloc (st->wid * st->hei); + st->point = (unsigned char *) calloc (1, st->wid * st->hei); maininit (st); palupdate (st, True); consume_instring(st); @@ -807,6 +807,11 @@ static void vermiculate_reshape (Display *dpy, Window window, void *closure, unsigned int w, unsigned int h) { + struct state *st = (struct state *) closure; + st->wid = w; + st->hei = h; + free (st->point); + st->point = (unsigned char *) calloc (1, st->wid * st->hei); } static Bool