mm->height = model_h;
mm->cells = malloc (sizeof (unsigned short) * model_w * model_h);
- if (!mm->cells)
+ if (!mm->cells) {
+ free (mm);
return 0;
+ }
return mm;
}
model_w = 80;
st->settings.cell_size = st->wattr.width / model_w;
model_h = st->settings.cell_size ?
- st->wattr.height / st->settings.cell_size : 0;
+ st->wattr.height / st->settings.cell_size : 1;
/* Construct the initial model state. */
st->fgc = XCreateGC (st->dpy, st->window, 0, &st->gcv);
-#ifdef HAVE_COCOA
+#ifdef HAVE_JWXYZ
jwxyz_XSetAntiAliasing (dpy, st->fgc, False);
jwxyz_XSetAntiAliasing (dpy, st->bgc, False);
#endif