http://packetstormsecurity.org/UNIX/admin/xscreensaver-3.32.tar.gz
[xscreensaver] / hacks / phosphor.c
index 105f9b5bcf7f0146d983c6e26b9d581bc933018f..1188f2e60696504e35889b621005504dcebb0558 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1999 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1999, 2000 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
@@ -300,7 +300,7 @@ capture_font_bits (p_state *state)
         continue;
       XDrawString (state->dpy, p, state->gc1,
                    i * safe_width, font->ascent,
-                   string + i, 1);
+                   (char *) (string + i), 1);
     }
 
   /* Draw the cursor. */
@@ -529,6 +529,7 @@ static void
 scroll (p_state *state)
 {
   int x, y;
+
   for (x = 0; x < state->grid_width; x++)
     {
       p_cell *from = 0, *to = 0;
@@ -553,7 +554,7 @@ scroll (p_state *state)
         }
 
       to = from;
-      if (to->state == FLARE || to->state == NORMAL)
+      if (to && (to->state == FLARE || to->state == NORMAL))
         {
           to->state = FADE;
           to->changed = True;