X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fdmm%2Fm2110.c;h=4f3af6940c062e2a9a28aa12e09a14f2fab9f613;hb=HEAD;hp=fc09276561b6e60b134e2438b7c3a79f4605a40d;hpb=8882e7e6cf121edec20db5651eababacd9b6503c;p=libsigrok.git diff --git a/src/dmm/m2110.c b/src/dmm/m2110.c index fc092765..4f3af694 100644 --- a/src/dmm/m2110.c +++ b/src/dmm/m2110.c @@ -44,7 +44,7 @@ SR_PRIV gboolean sr_m2110_packet_valid(const uint8_t *buf) if (!strncmp((const char *)buf, "OVERRNG", 7)) return TRUE; - if (sscanf((const char *)buf, "%f", &val) == 1) + if (sr_atof_ascii((const char *)buf, &val) == SR_OK) return TRUE; else return FALSE; @@ -65,7 +65,7 @@ SR_PRIV int sr_m2110_parse(const uint8_t *buf, float *floatval, if (!strncmp((const char *)buf, "OVERRNG", 7)) *floatval = INFINITY; - else if (sscanf((const char *)buf, "%f", &val) == 1) { + else if (sr_atof_ascii((const char *)buf, &val) == SR_OK) { *floatval = val; dot_pos = strcspn((const char *)buf, "."); if (dot_pos < 7)