                   lcd.blink(); }
                else if (charnum < MAX_FILENAME) {
                   ++charnum;
-                  if (file_hdr.filename[charnum] == '\0') // if we're going beyond the end
-                     file_hdr.filename[charnum] = ' '; // change to a blank
-                  file_hdr.filename[charnum + 1] = '\0'; // and make a new end
-               } }
+                  if (file_hdr.filename[charnum] == '\0') { // if we're going beyond the end
+                     file_hdr.filename[charnum] = ' ';        // change NUL to a blank
+                     file_hdr.filename[charnum + 1] = '\0';   // and make a new NUL end
+                  } } }
             break;
          case eVrotR:  // move down
             if (!save || row_select) {

   read_EEPROM(&fromloc, (char*) tieup, sizeof(tieup));
   read_EEPROM(&fromloc, (char*) treadle_sequence, sizeof(treadle_sequence));
   cleanup_treadle_sequence();
   if (DEBUG) dump_file("file read:"); }

void display_files (int filenum) {

               if (!row_select) { // name entry: go to next char
                  if (charnum < MAX_FILENAME) ++charnum; }
               else { // abort writing
                  cleanup_filename(file_hdr.filename);
                  info_message("file save aborted", 0);
                  goto exit_loadsave; } }
            else { // load file
               read_file_data(filenum);
               sprintf (string, "file %d loaded", filenum + 1);
               info_message(string, file_hdr.filename);
               write_config(); // record this file number in EEPROM
               goto exit_loadsave; }
            break;
         case ePB1:  // other buttons: exit
