Index: trunk/Mars/hawc/plot_callisto.C
===================================================================
--- trunk/Mars/hawc/plot_callisto.C	(revision 19734)
+++ trunk/Mars/hawc/plot_callisto.C	(revision 19735)
@@ -6,7 +6,8 @@
     {
         timer.TurnOn();
-        TString input = Getline("Type 'q' to exit, or event number and <return> to go on: ");
+        const char *gl = Getline("Type 'q' to exit, or event number and <return> to go on: ");
         timer.TurnOff();
 
+        TString input = gl;
         if (input=="q\n")
             return -1;
@@ -57,4 +58,7 @@
     while (evtnum>=0)
     {
+        if (evtnum>=T->GetEntries())
+            evtnum = 0;
+
         T->GetEntry(evtnum);
 
