Fix GPS ident overflow bug
This commit is contained in:
parent
e15d67e637
commit
a3e66d1ae3
1 changed files with 4 additions and 4 deletions
|
@ -947,8 +947,8 @@ const char* GPS::getWP0Ident() const
|
|||
|
||||
// work around std::string::c_str() storage lifetime with libc++
|
||||
// real fix is to allow tie-ing with std::string instead of char*
|
||||
static char identBuf[8];
|
||||
strncpy(identBuf, _prevWaypt->ident().c_str(), 8);
|
||||
static char identBuf[16];
|
||||
strncpy(identBuf, _prevWaypt->ident().c_str(), 15);
|
||||
|
||||
return identBuf;
|
||||
}
|
||||
|
@ -975,8 +975,8 @@ const char* GPS::getWP1Ident() const
|
|||
|
||||
// work around std::string::c_str() storage lifetime with libc++
|
||||
// real fix is to allow tie-ing with std::string instead of char*
|
||||
static char identBuf[8];
|
||||
strncpy(identBuf, _currentWaypt->ident().c_str(), 8);
|
||||
static char identBuf[16];
|
||||
strncpy(identBuf, _currentWaypt->ident().c_str(), 15);
|
||||
|
||||
return identBuf;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue