Skip to content

Commit

Permalink
'mergetle' sorted NORAD numbers lexicographically rather than numeric…
Browse files Browse the repository at this point in the history
…ally. Leading zeroes could cause confusion (e.g., '03141' wasn't considered equal to ' 3141').
  • Loading branch information
Bill-Gray committed Jul 1, 2024
1 parent 627f490 commit 2229953
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mergetle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ int tle_compare( const TLE *tle1, const TLE *tle2, const char sort_method)
switch( sort_method)
{
case 'n': case 'N': /* sort by NORAD number */
for( i = 2; !rval && i < 8; i++)
rval = tle1->line1[i] - tle2->line1[i];
rval = atoi( tle1->line1 + 2) - atoi( tle2->line1 + 2);
break;
case 'c': case 'C': /* sort by COSPAR (international) desig */
if( tle1->line1[9] >= '5' && tle2->line1[9] < '5')
Expand Down

0 comments on commit 2229953

Please sign in to comment.