Eeschema: Fix off-by-one in saving bitmaps
This commit is contained in:
parent
66aee09388
commit
58af5bc3a4
|
@ -107,9 +107,8 @@ bool BITMAP_BASE::SaveData( FILE* aFile ) const
|
||||||
// Write binary data in hexadecimal form (ASCII)
|
// Write binary data in hexadecimal form (ASCII)
|
||||||
wxStreamBuffer* buffer = stream.GetOutputStreamBuffer();
|
wxStreamBuffer* buffer = stream.GetOutputStreamBuffer();
|
||||||
char* begin = (char*) buffer->GetBufferStart();
|
char* begin = (char*) buffer->GetBufferStart();
|
||||||
int ii;
|
|
||||||
|
|
||||||
for( ii = 0; begin <= buffer->GetBufferEnd(); begin++, ii++ )
|
for( int ii = 0; begin < buffer->GetBufferEnd(); begin++, ii++ )
|
||||||
{
|
{
|
||||||
if( ii >= 32 )
|
if( ii >= 32 )
|
||||||
{
|
{
|
||||||
|
@ -140,7 +139,7 @@ void BITMAP_BASE::SaveData( wxArrayString& aPngStrings ) const
|
||||||
char* begin = (char*) buffer->GetBufferStart();
|
char* begin = (char*) buffer->GetBufferStart();
|
||||||
wxString line;
|
wxString line;
|
||||||
|
|
||||||
for( int ii = 0; begin <= buffer->GetBufferEnd(); begin++, ii++ )
|
for( int ii = 0; begin < buffer->GetBufferEnd(); begin++, ii++ )
|
||||||
{
|
{
|
||||||
if( ii >= 32 )
|
if( ii >= 32 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -1707,7 +1707,7 @@ void SCH_LEGACY_PLUGIN::saveBitmap( SCH_BITMAP* aBitmap )
|
||||||
wxStreamBuffer* buffer = stream.GetOutputStreamBuffer();
|
wxStreamBuffer* buffer = stream.GetOutputStreamBuffer();
|
||||||
char* begin = (char*) buffer->GetBufferStart();
|
char* begin = (char*) buffer->GetBufferStart();
|
||||||
|
|
||||||
for( int ii = 0; begin <= buffer->GetBufferEnd(); begin++, ii++ )
|
for( int ii = 0; begin < buffer->GetBufferEnd(); begin++, ii++ )
|
||||||
{
|
{
|
||||||
if( ii >= 32 )
|
if( ii >= 32 )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue