From bc31bdbbbbd97f08bbcb77aea34b60de9fa9fb1f Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Thu, 12 Aug 2010 13:03:26 +0200 Subject: [PATCH] use simgear::strutils::rpad() instead of strncpy() --- src/Instrumentation/navradio.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Instrumentation/navradio.cxx b/src/Instrumentation/navradio.cxx index d10076278..0970cae5a 100644 --- a/src/Instrumentation/navradio.cxx +++ b/src/Instrumentation/navradio.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include @@ -878,12 +879,12 @@ void FGNavRadio::search() } _navaid = nav; - char identBuffer[5] = " "; + string identBuffer(4, ' '); if (nav) { _dme = globals->get_dmelist()->findByFreq(freq, pos); nav_id_node->setStringValue(nav->get_ident()); - strncpy(identBuffer, nav->ident().c_str(), 5); + identBuffer = simgear::strutils::rpad( nav->ident(), 4, ' ' ); effective_range = adjustNavRange(nav->get_elev_ft(), pos.getElevationM(), nav->get_range()); loc_node->setBoolValue(nav->type() != FGPositioned::VOR);