This seems to work!!!!
/* GLOBALS */
uint64_t charnumber = 0;
int readLine (File myFile, char *s, int size )
{
int n = 0;
while (myFile.available () > 0)
{
char c = myFile.read ();
charnumber++; // Count the chars
if (c != '\r')
s [n++] = c;
if (size <= n || '\n' == c)
{
s [n-1] = 0;
break;
}
}
return n;
}
// -------------------------------------
void readPasswords (void)
{
File myFile = SD.open (FILENAME);
char str [80];
int currentLoop = 0;
nPassword = 0;
if ( charnumber > 0 ) { // Skip to where we left off!!!!!!
myFile.seek(charnumber);
}
while (readLine (myFile, str, sizeof (str)))
{
char *p = & password [nPassword++][0];
strncpy (p, str, PASSWORDLENGTH); // destination, source
currentLoop++;
if (currentLoop == NUMBEROFPASSWORDS)
{
currentLoop = 0;
break;
}
}
}