1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 12:40:35 +00:00
This commit is contained in:
Carles Fernandez 2018-05-21 21:31:03 +02:00
commit 10d102feca
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
4 changed files with 56 additions and 35 deletions

View File

@ -1493,7 +1493,6 @@ void decodeftppath(const char *path, char *addr, char *file, char *user,
*q = '\0'; *q = '\0';
if (passwd) strcpy(passwd, q + 1); if (passwd) strcpy(passwd, q + 1);
} }
if (*q != 0) *q = '\0';
if (user) strcpy(user, buff); if (user) strcpy(user, buff);
} }
else else

View File

@ -565,6 +565,11 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
std::cerr << " - " << name << std::endl; std::cerr << " - " << name << std::endl;
return false; return false;
} }
catch (std::string s)
{
std::cerr << "Error: " << s << std::endl;
return false;
}
//pull the input scalars into their own vector //pull the input scalars into their own vector
std::vector<volk_gnsssdr_type_t> inputsc; std::vector<volk_gnsssdr_type_t> inputsc;

View File

@ -56,6 +56,7 @@
#include <stdexcept> #include <stdexcept>
#include <cstdio> #include <cstdio>
#include <cstdlib> // for getenv() #include <cstdlib> // for getenv()
#include <cstring> // for strncpy
#include <cmath> #include <cmath>
#include <list> // for std::list #include <list> // for std::list
@ -1962,15 +1963,20 @@ bool Gnuplot::get_program_path()
char *path; char *path;
// Retrieves a C string containing the value of environment variable PATH // Retrieves a C string containing the value of environment variable PATH
path = std::getenv("PATH"); path = std::getenv("PATH");
char secured_path[4096];
if (path == NULL || std::char_traits<char>::length(path) > 4096 * sizeof(char)) size_t len = strlen(path);
if (path && len < 4046 * sizeof(char))
{ {
throw GnuplotException("Path is not set"); strncpy(secured_path, path, len);
} }
else else
{ {
throw GnuplotException("Path is not set or it is too long");
}
secured_path[len] = '\0';
std::string path_str(secured_path);
std::list<std::string> ls; std::list<std::string> ls;
std::string path_str(path);
//split path (one long string) into list ls of strings //split path (one long string) into list ls of strings
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__)
@ -2000,7 +2006,6 @@ bool Gnuplot::get_program_path()
Gnuplot::m_sGNUPlotPath = ""; Gnuplot::m_sGNUPlotPath = "";
throw GnuplotException(tmp); throw GnuplotException(tmp);
} }
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

View File

@ -477,7 +477,19 @@ int main(int argc, char** argv)
if (global_gps_ephemeris_map.size() > 0) if (global_gps_ephemeris_map.size() > 0)
{ {
std::map<int, Gps_Ephemeris> Eph_map; std::map<int, Gps_Ephemeris> Eph_map;
try
{
Eph_map = global_gps_ephemeris_map.get_map_copy(); Eph_map = global_gps_ephemeris_map.get_map_copy();
}
catch (const boost::exception& e)
{
std::cout << "Exception in getting Global ephemeris map" << std::endl;
delete acquisition;
delete gnss_synchro;
google::ShutDownCommandLineFlags();
std::cout << "GNSS-SDR Front-end calibration program ended." << std::endl;
return 0;
}
current_TOW = Eph_map.begin()->second.d_TOW; current_TOW = Eph_map.begin()->second.d_TOW;
time_t t = utc_time(Eph_map.begin()->second.i_GPS_week, (long int)current_TOW); time_t t = utc_time(Eph_map.begin()->second.i_GPS_week, (long int)current_TOW);