/* erase.c: Erase the screen in various more or less interesting ways.
- * Copyright (c) 1997-2001, 2006 Jamie Zawinski <jwz@jwz.org>
+ * Copyright (c) 1997-2008 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
{
st->cols = 10 + random() % 30;
size = st->width / st->cols;
- rows = (st->height / size) + 1;
+ rows = (size ? (st->height / size) : 0) + 1;
st->nlines = st->cols * rows;
st->lines = (int *) calloc (st->nlines, sizeof(*st->lines));
}
size = st->width / st->cols;
- rows = (st->height / size) + 1;
+ rows = (size ? (st->height / size) : 0) + 1;
for (i = st->nlines * st->prev_ratio;
i < st->nlines * st->ratio;
for (y = 0; y < st->height; y += h)
{
- if (tick & 1)
+ if (st->width <= step)
+ ;
+ else if (tick & 1)
{
XCopyArea (st->dpy, st->window, st->window, st->fg_gc,
0, y, st->width-step, h, step, y);