fix for bug 1022026

This commit is contained in:
Dick Hollenbeck 2012-07-07 13:27:44 -05:00
parent 04a17d3347
commit 1da099dd1f
1 changed files with 10 additions and 3 deletions

View File

@ -106,10 +106,16 @@ typedef LEGACY_PLUGIN::BIU BIU;
#define SZ( x ) (sizeof(x)-1)
static const char delims[] = " \t\r\n";
static bool inline isSpace( int c ) { return strchr( delims, c ) != 0; }
//-----<BOARD Load Functions>---------------------------------------------------
/// C string compare test for a specific length of characters.
#define TESTLINE( x ) ( !strnicmp( line, x, SZ( x ) ) && isspace( line[SZ( x )] ) )
#define TESTLINE( x ) ( !strnicmp( line, x, SZ( x ) ) && isSpace( line[SZ( x )] ) )
/// C sub-string compare test for a specific length of characters.
#define TESTSUBSTR( x ) ( !strnicmp( line, x, SZ( x ) ) )
@ -141,7 +147,6 @@ static inline unsigned ReadLine( LINE_READER* rdr, const char* caller )
#define READLINE( rdr ) ReadLine( rdr, __FUNCTION__ )
#endif
static const char delims[] = " \t\r\n";
using namespace std; // auto_ptr
@ -1101,8 +1106,10 @@ void LEGACY_PLUGIN::loadPAD( MODULE* aModule )
data = data + ReadDelimitedText( mypadname, data, sizeof(mypadname) ) + 1; // +1 trailing whitespace
// sscanf( PtLine, " %s %d %d %d %d %d", BufCar, &m_Size.x, &m_Size.y, &m_DeltaSize.x, &m_DeltaSize.y, &m_Orient );
while( isSpace( *data ) )
++data;
int padshape = *data++;
BIU size_x = biuParse( data, &data );
BIU size_y = biuParse( data, &data );
BIU delta_x = biuParse( data, &data );