Scrolling matrix display

I sort of got it to work. I created a new function that doesn't loop and resets the counters. Still can't get it to finish cleanly. What is a good way for it to stop when all the characters are displayed? Here is what I have.

void staticDisplay()
{
  
curcharix = 0;
curcharbit = 0;
curcharixsave = 0;
curcharbitsave = 0;
curcharixsave2 = 0;
curcharbitsave2 = 0;

clearDisplay();
  

  
    for (i=devCount-1;i>=0;i--) // Loop through our 8 displays
    {
      for (j=0;j<8;j++) // Set up rows on current  display
      {      
        byte outputbyte = 0;
   
        curchar = msg[curcharix];
   
        curcharixsave = curcharix;
        curcharbitsave = curcharbit;
      
        for (k=7;k>=0;k--) // Copy over data for 8 columns to current row and send it to current display
        {
          // This byte is the bitmap of the current character for the current row
          byte currentcharbits = Font8x5[((curchar-32)*8)+j];
      
          if (currentcharbits & (1<<curcharbit))
            outputbyte |= (1<<k);
      
          // advance the current character bit of current character
      
          curcharbit ++;
      
          if (curcharbit > lentbl_S[curchar-32]) // we are past the end of this character, so advance.
          {
            curcharbit = 0;
            curcharix += 1; 
            if (curcharix+1 > msgsize) curcharix=0; //This is what I was playing with.
            curchar = msg[curcharix];
          }
        }
      
        lc.setRow(i, j, outputbyte);
        
     

        if (j != 7) // if this is not the last row, roll back advancement, if it is, leave the counters advanced.
        {
          curcharix = curcharixsave;
          curcharbit = curcharbitsave;
        }

      }
    }

  

  
}