From 27dea7826dbc38f5f123e5324a557a877ac3106e Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Mon, 27 Dec 2010 23:52:22 -0600 Subject: [PATCH] more IO_ERROR constructor fixes --- new/sch_dir_lib_source.cpp | 2 +- new/sch_lib_table.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/new/sch_dir_lib_source.cpp b/new/sch_dir_lib_source.cpp index fa778e8e8f..b8a43bf807 100644 --- a/new/sch_dir_lib_source.cpp +++ b/new/sch_dir_lib_source.cpp @@ -362,7 +362,7 @@ DIR_LIB_SOURCE::DIR_LIB_SOURCE( const STRING& aDirectoryPath, if( sourceURI.size() == 0 ) { - throw( IO_ERROR( "aDirectoryPath cannot be empty" ) ); + throw( IO_ERROR( STRING("aDirectoryPath cannot be empty") ) ); } // remove any trailing separator, so we can add it back later without ambiguity diff --git a/new/sch_lib_table.cpp b/new/sch_lib_table.cpp index 0e843dc68f..ad2710faef 100644 --- a/new/sch_lib_table.cpp +++ b/new/sch_lib_table.cpp @@ -134,12 +134,13 @@ void LIB_TABLE::Parse( SCH_LIB_TABLE_LEXER* in ) throw( IO_ERROR ) // before any fall back. if( !InsertRow( row ) ) { - char buf[300]; + STRING msg; - snprintf( buf, sizeof(buf), - "'%s' is a duplicate logical lib name", - row->logicalName.c_str() ); - throw IO_ERROR( buf ); + msg += '\''; + msg += row->logicalName; + msg += '\''; + msg += " is a duplicate logical lib name"; + throw IO_ERROR( msg ); } } return;