From 13b0784cd59463b001f5877f1c153d88e7539941 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 24 Jul 2014 08:43:23 +0200 Subject: [PATCH] Fix overflow in track len calculations and display (Bug #1347878). --- pcbnew/class_board.cpp | 4 ++-- pcbnew/class_track.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index 6496692a47..b51657ff0a 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -1878,10 +1878,10 @@ TRACK* BOARD::MarkTrace( TRACK* aTrace, int* aCount, } if( aTraceLength ) - *aTraceLength = KiROUND( full_len ); + *aTraceLength = full_len; if( aPadToDieLength ) - *aPadToDieLength = KiROUND( lenPadToDie ); + *aPadToDieLength = lenPadToDie; if( aCount ) *aCount = NbSegmBusy; diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index 18059d5a4e..d190a9449f 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -1002,7 +1002,7 @@ void TRACK::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ) double trackLen = 0; double lenPadToDie = 0; board->MarkTrace( this, NULL, &trackLen, &lenPadToDie, false ); - msg = ::CoordinateToString( trackLen ); + msg = ::LengthDoubleToString( trackLen ); aList.push_back( MSG_PANEL_ITEM( _( "Track Len" ), msg, DARKCYAN ) ); if( lenPadToDie != 0 )