Skip to content

Commit

Permalink
sprintf() is deprecated in favor of snprintf(). It's a good step, tho…
Browse files Browse the repository at this point in the history
…ugh I'd argue in favor of an error-generating variant here (see 'stringex.h' in the 'lunar' repository).
  • Loading branch information
Bill-Gray committed Sep 26, 2023
1 parent f725be4 commit 1b40200
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sat_eph.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ static int show_ephems_from( const char *path_to_tles, const ephem_t *e,
{
const char precision = format_string[5];

sprintf( buff, " %%+7.%cf %%+7.%cf", precision, precision);
snprintf( buff, sizeof( buff),
" %%+7.%cf %%+7.%cf", precision, precision);
printf( buff, ra_motion * (double)motion_units,
dec_motion * (double)motion_units);
}
Expand Down

0 comments on commit 1b40200

Please sign in to comment.