 void startReplay(String fileName)
 {
     // open specified file
-    char buf[fileName.length()];
-    fileName.toCharArray(buf, fileName.length(), 0);
+    char buf[fileName.length() + 1];
+    fileName.toCharArray(buf, fileName.length() + 1, 0);
     replayFile = SD.open(buf);
     if (replayFile)
     {

		dtostrf(GPS.altitude, 6, 2, galt);

		//printBuffer += "\r\nL:";
		printBuffer += lat; printBuffer += GPS.lat; printBuffer += ',';
		printBuffer += lon; printBuffer += GPS.lon; printBuffer += ',';
		printBuffer += spd; printBuffer += ','; //printBuffer += "kn,";
		printBuffer += ang; printBuffer += ','; //printBuffer += "dg,";
		printBuffer += galt; printBuffer += ','; //printBuffer += "m,";

                    bufIndex++;
                }
            }
            logInterval = 1;
        }
        else
        {
            logInterval = counter - 1;
        }
    }
    else
