]> sigrok.org Git - pulseview.git/commitdiff
DeviceOptions::print_vdiv: Replace C-style string formatting with QString arg formatting
authorJoel Holdsworth <redacted>
Sat, 24 May 2014 10:23:08 +0000 (11:23 +0100)
committerJoel Holdsworth <redacted>
Sat, 24 May 2014 10:23:08 +0000 (11:23 +0100)
pv/prop/binding/deviceoptions.cpp

index a2a741709145b6529625d77218623a1d5b27c7cd..8811b6f3a21f73976a09a207203bd4184ad50ee0 100644 (file)
@@ -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