Skip to content

Commit

Permalink
Added some debugging to save results of a possibly corrupted temporar…
Browse files Browse the repository at this point in the history
…y ephemeris file. This is to aid in figuring out a NEOfixer problem; with any luck, this commit will be reverted shortly.
  • Loading branch information
Bill-Gray committed Jun 25, 2023
1 parent 4c6a690 commit 90e6058
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ephem0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,16 @@ static int create_json_ephemeris( FILE *ofile, FILE *ifile, char *header,
const char *preceder = (line_no ? ",\n" : "");
const int step_number = (step ? (int)(( atof( buff) - jd_start) / step + .5) : line_no);

if( step_number < 0)
{
FILE *debug_file = fopen_ext( "ephem.err", "tfcwb");

fseek( ifile, 0L, SEEK_SET);
while( fgets_trimmed( buff, sizeof( buff), ifile))
fprintf( debug_file, "%s\n", buff);
fclose( debug_file);
return( -1);
}
fprintf( ofile, "%s \"%d\": {", preceder, step_number);
while( *hptr && *bptr)
{
Expand Down

0 comments on commit 90e6058

Please sign in to comment.