From: Joel Holdsworth Date: Sat, 24 May 2014 10:23:08 +0000 (+0100) Subject: DeviceOptions::print_vdiv: Replace C-style string formatting with QString arg formatting X-Git-Tag: pulseview-0.3.0~607 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=b47e449a777042854f75dc7609e137c52d3bf699;p=pulseview.git DeviceOptions::print_vdiv: Replace C-style string formatting with QString arg formatting --- diff --git a/pv/prop/binding/deviceoptions.cpp b/pv/prop/binding/deviceoptions.cpp index a2a74170..8811b6f3 100644 --- a/pv/prop/binding/deviceoptions.cpp +++ b/pv/prop/binding/deviceoptions.cpp @@ -183,10 +183,8 @@ QString DeviceOptions::print_vdiv(GVariant *const gvar) QString DeviceOptions::print_voltage_threshold(GVariant *const gvar) { gdouble lo, hi; - char buf[64]; g_variant_get(gvar, "(dd)", &lo, &hi); - snprintf(buf, sizeof(buf), "L<%.1fV H>%.1fV", lo, hi); - return QString::fromUtf8(buf); + return QString("L<%1V H>%2V").arg(lo, 0, 'f', 1).arg(hi, 0, 'f', 1); } } // binding