X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fsquiral.c;h=3e13116e534e0c63219bf884362c10fd0100d0fd;hp=dbde586f7d922f24b352f2428e0ca56bcd86302c;hb=07faf451b99879183ed7e909e43a0e065be1ee7f;hpb=49f5b54f312fe4ac2e9bc47581a72451bd0e8439 diff --git a/hacks/squiral.c b/hacks/squiral.c index dbde586f..3e13116e 100644 --- a/hacks/squiral.c +++ b/hacks/squiral.c @@ -198,10 +198,12 @@ squiral_draw (Display *dpy, Window window, void *closure) memset(&st->fill[(st->height-st->inclear-1)*st->width], 0, sizeof(int)*st->width); st->inclear++; XDrawLine(st->dpy, st->window, st->erase_gc, 0, st->inclear, st->width-1, st->inclear); - memset(&st->fill[st->inclear*st->width], 0, sizeof(int)*st->width); + if (st->inclear < st->height) + memset(&st->fill[st->inclear*st->width], 0, sizeof(int)*st->width); XDrawLine(st->dpy, st->window, st->erase_gc, 0, st->height-st->inclear-1, st->width-1, st->height-st->inclear-1); - memset(&st->fill[(st->height-st->inclear-1)*st->width], 0, sizeof(int)*st->width); + if (st->height - st->inclear >= 1) + memset(&st->fill[(st->height-st->inclear-1)*st->width], 0, sizeof(int)*st->width); st->inclear++; if(st->inclear>st->height/2) st->inclear=st->height; }