mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-14 20:20:35 +00:00
Merge branch 'next' of https://github.com/carlesfernandez/gnss-sdr into next
This commit is contained in:
commit
b0c1c26b3e
@ -594,11 +594,7 @@ private:
|
||||
inline void encode_header()
|
||||
{
|
||||
char header[header_length + 1] = "";
|
||||
int num_chars = std::snprintf(header, header_length + 1, "GS%4d", std::min(static_cast<int>(body_length_), static_cast<int>(max_body_length)));
|
||||
if ((num_chars <= 0) or (num_chars > header_length))
|
||||
{
|
||||
// avoid Wformat-truncation warning
|
||||
}
|
||||
std::snprintf(header, header_length + 1, "GS%4d", std::max(std::min(static_cast<int>(body_length_), static_cast<int>(max_body_length)), 0));
|
||||
std::memcpy(data_, header, header_length);
|
||||
}
|
||||
|
||||
|
@ -463,7 +463,7 @@ void readtec(const char *file, nav_t *nav, int opt)
|
||||
}
|
||||
for (i = 0; i < MAXEXFILE; i++)
|
||||
{
|
||||
if (!(efiles[i] = static_cast<char *>(malloc(1024))))
|
||||
if (!(efiles[i] = static_cast<char *>(malloc(MAXSTRPATH + 255))))
|
||||
{
|
||||
for (i--; i >= 0; i--)
|
||||
{
|
||||
|
@ -420,7 +420,7 @@ void readsp3(const char *file, nav_t *nav, int opt)
|
||||
|
||||
for (i = 0; i < MAXEXFILE; i++)
|
||||
{
|
||||
if (!(efiles[i] = static_cast<char *>(malloc(1024))))
|
||||
if (!(efiles[i] = static_cast<char *>(malloc(MAXSTRPATH + 255))))
|
||||
{
|
||||
for (i--; i >= 0; i--)
|
||||
{
|
||||
@ -601,7 +601,7 @@ int readdcb(const char *file, nav_t *nav, const sta_t *sta)
|
||||
}
|
||||
for (i = 0; i < MAXEXFILE; i++)
|
||||
{
|
||||
if (!(efiles[i] = static_cast<char *>(malloc(1024))))
|
||||
if (!(efiles[i] = static_cast<char *>(malloc(MAXSTRPATH + 255))))
|
||||
{
|
||||
for (i--; i >= 0; i--)
|
||||
{
|
||||
|
@ -5278,7 +5278,7 @@ int expath(const char *path, char *paths[], int nmax)
|
||||
}
|
||||
if (p && n < nmax)
|
||||
{
|
||||
std::snprintf(paths[n++], MAXSTRPATH, "%s%s", dir, d->d_name);
|
||||
std::snprintf(paths[n++], MAXSTRPATH + 255, "%s%s", dir, d->d_name);
|
||||
}
|
||||
}
|
||||
closedir(dp);
|
||||
|
@ -782,7 +782,7 @@ int sbsreadmsgt(const char *file, int sel, gtime_t ts, gtime_t te,
|
||||
|
||||
for (i = 0; i < MAXEXFILE; i++)
|
||||
{
|
||||
if (!(efiles[i] = static_cast<char *>(malloc(1024))))
|
||||
if (!(efiles[i] = static_cast<char *>(malloc(MAXSTRPATH + 255))))
|
||||
{
|
||||
for (i--; i >= 0; i--)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user