@@ -435,7 +435,7 @@ void beginLogging(const char *customFileName)
435
435
{
436
436
reuseLastLog = false ;
437
437
438
- if (findLastLog (logFileName) == false )
438
+ if (findLastLog (logFileName, sizeof (logFileName) ) == false )
439
439
log_d (" Failed to find last log. Making new one." );
440
440
else
441
441
log_d (" Using last log file." );
@@ -625,7 +625,7 @@ void endLogging(bool gotSemaphore, bool releaseSemaphore)
625
625
626
626
// Finds last log
627
627
// Returns true if succesful
628
- bool findLastLog (char *lastLogName )
628
+ bool findLastLog (char *lastLogNamePrt, int lastLogNameSize )
629
629
{
630
630
bool foundAFile = false ;
631
631
@@ -659,7 +659,7 @@ bool findLastLog(char *lastLogName)
659
659
{
660
660
if (strstr (fname, LOG_PREFIX) != nullptr )
661
661
{
662
- strncpy (lastLogName , fname, sizeof (lastLogName) - 1 ); // Store this file as last known log file
662
+ strncpy (lastLogNamePrt , fname, lastLogNameSize - 1 ); // Store this file as last known log file
663
663
foundAFile = true ;
664
664
}
665
665
}
@@ -692,7 +692,7 @@ bool findLastLog(char *lastLogName)
692
692
{
693
693
if (strstr (fname, LOG_PREFIX) != nullptr )
694
694
{
695
- strncpy (lastLogName , fname, sizeof (lastLogName) - 1 ); // Store this file as last known log file
695
+ strncpy (lastLogNamePrt , fname, lastLogNameSize - 1 ); // Store this file as last known log file
696
696
foundAFile = true ;
697
697
}
698
698
}
0 commit comments