Skip to content

Commit

Permalink
Interactive Find_Orb's handling of observer location entries for ephe…
Browse files Browse the repository at this point in the history
…ms failed more than it ought to, sometimes without a warning message. It's now somewhat more robust.
  • Loading branch information
Bill-Gray committed Nov 16, 2023
1 parent 2b15fbf commit b77e034
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions findorb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1294,14 +1294,20 @@ static void create_ephemeris( const double *orbit, const double epoch_jd,
{
if( strlen( buff) < 3)
err_msg = "MPC codes must be at least three characters long";
else if( strlen( buff) < 5 || !memcmp( buff, "Ast", 3))
else if( strlen( buff) < 5 || !memcmp( buff, "Ast", 3)
|| !get_lat_lon_info( NULL, buff))
strlcpy_error( mpc_code, buff);
else if( strlen( buff) > 4 && !get_observer_data( buff, buff, NULL))
else if( strlen( buff) > 4)
{
buff[4] = '\0';
if( buff[3] == ' ')
buff[3] = '\0';
strlcpy_error( mpc_code, buff);
if( !get_observer_data( buff, buff, NULL))
{
buff[4] = '\0';
if( buff[3] == ' ')
buff[3] = '\0';
strlcpy_error( mpc_code, buff);
}
else
err_msg = "Didn't understand that observatory code";
}
}
break;
Expand Down

0 comments on commit b77e034

Please sign in to comment.