Browse Source

Fix warnings about sprintf use.

newinvert
Marek Roszko 2 years ago
parent
commit
71383c9c73
  1. 4
      pcb_calculator/transline/coax.cpp
  2. 6
      pcb_calculator/transline/rectwaveguide.cpp
  3. 6
      thirdparty/dxflib_qcad/dl_writer_ascii.cpp

4
pcb_calculator/transline/coax.cpp

@ -238,7 +238,7 @@ void COAX::show_results()
while( ( m_parameters[CUTOFF_FREQUENCY_PRM] <= m_parameters[FREQUENCY_PRM] ) && ( m < 10 ) )
{
sprintf( txt, "H(n,%d) ", m );
snprintf( txt, sizeof( text ), "H(n,%d) ", m );
strcat( text, txt );
m++;
m_parameters[CUTOFF_FREQUENCY_PRM] =
@ -262,7 +262,7 @@ void COAX::show_results()
while( ( m_parameters[CUTOFF_FREQUENCY_PRM] <= m_parameters[FREQUENCY_PRM] ) && ( m < 10 ) )
{
sprintf( txt, "E(n,%d) ", m );
snprintf( txt, sizeof( text ), "E(n,%d) ", m );
strcat( text, txt );
m++;
m_parameters[CUTOFF_FREQUENCY_PRM] =

6
pcb_calculator/transline/rectwaveguide.cpp

@ -279,7 +279,7 @@ void RECTWAVEGUIDE::calcAnalyze()
/*
* synthesize - synthesis function
* source: re-arrangment of calcAnalyze equation
* TE10 (via fc(1,0) ) results in the b term not influencing the result, as long as
* TE10 (via fc(1,0) ) results in the b term not influencing the result, as long as
* 1) fc > f
* 2) a > b
*/
@ -400,7 +400,7 @@ void RECTWAVEGUIDE::show_results()
if( m_parameters[FREQUENCY_PRM] >= ( fc( m, n ) ) )
{
sprintf( txt, "H(%d,%d) ", m, n );
snprintf( txt, sizeof( txt ), "H(%d,%d) ", m, n );
if( ( strlen( text ) + strlen( txt ) + 5 ) < MAXSTRLEN )
{
strcat( text, txt );
@ -430,7 +430,7 @@ void RECTWAVEGUIDE::show_results()
{
if( m_parameters[FREQUENCY_PRM] >= fc( m, n ) )
{
sprintf( txt, "E(%d,%d) ", m, n );
snprintf( txt, sizeof( txt ), "E(%d,%d) ", m, n );
if( ( strlen( text ) + strlen( txt ) + 5 ) < MAXSTRLEN )
{
strcat( text, txt );

6
thirdparty/dxflib_qcad/dl_writer_ascii.cpp

@ -62,11 +62,11 @@ void DL_WriterA::dxfReal( int gc, double value ) const
if( version==DL_Codes::AC1009_MIN )
{
sprintf( str, "%.6lf", value );
snprintf( str, sizeof( str ), "%.6lf", value );
}
else
{
sprintf( str, "%.16lf", value );
snprintf( str, sizeof( str ), "%.16lf", value );
}
// fix for german locale:
@ -122,7 +122,7 @@ void DL_WriterA::dxfHex( int gc, int value ) const
{
char str[12];
sprintf( str, "%0X", value );
snprintf( str, sizeof( str ), "%0X", value );
dxfString( gc, str );
}

Loading…
Cancel
Save