Fix incorrect pin num string in cadstar and orcadpcb2 format

This commit is contained in:
jean-pierre charras 2018-03-15 09:15:49 +01:00
parent 213b600b54
commit e14a7c928c
2 changed files with 8 additions and 13 deletions

View File

@ -1,9 +1,9 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2013 jp.charras at wanadoo.fr
* Copyright (C) 1992-2018 jp.charras at wanadoo.fr
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.TXT for contributors.
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -165,15 +165,10 @@ bool NETLIST_EXPORTER_CADSTAR::writeListOfNets( FILE* f )
{
case 0:
{
char buf[5];
wxString str_pinnum;
strncpy( buf, (char*) &nitem->m_PinNum, 4 );
buf[4] = 0;
str_pinnum = FROM_UTF8( buf );
InitNetDescLine.Printf( wxT( "\n%s %s %.4s %s" ),
GetChars( InitNetDesc ),
GetChars( refstr ),
GetChars( str_pinnum ),
GetChars( nitem->m_PinNum ),
GetChars( netcodeName ) );
}
print_ter++;
@ -184,14 +179,14 @@ bool NETLIST_EXPORTER_CADSTAR::writeListOfNets( FILE* f )
ret |= fprintf( f, "%s %s %.4s\n",
TO_UTF8( StartNetDesc ),
TO_UTF8( refstr ),
(char*) &nitem->m_PinNum );
TO_UTF8( nitem->m_PinNum ) );
print_ter++;
break;
default:
ret |= fprintf( f, " %s %.4s\n",
TO_UTF8( refstr ),
(char*) &nitem->m_PinNum );
TO_UTF8( nitem->m_PinNum ) );
break;
}

View File

@ -1,9 +1,9 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2013 jp.charras at wanadoo.fr
* Copyright (C) 1992-2018 jp.charras at wanadoo.fr
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.TXT for contributors.
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -128,7 +128,7 @@ bool NETLIST_EXPORTER_ORCADPCB2::WriteNetlist( const wxString& aOutFileName,
netName.Replace( wxT( " " ), wxT( "_" ) );
ret |= fprintf( f, " ( %4.4s %s )\n", (char*) &pin->m_PinNum,
ret |= fprintf( f, " ( %4.4s %s )\n", TO_UTF8( pin->m_PinNum ),
TO_UTF8( netName ) );
}