]> sigrok.org Git - libsigrok.git/commitdiff
hameg-hmo: Silence warning about format security.
authorpoljar (Damir Jelić) <redacted>
Thu, 16 Jan 2014 18:42:27 +0000 (19:42 +0100)
committerBert Vermeulen <redacted>
Thu, 16 Jan 2014 22:02:47 +0000 (23:02 +0100)
The command for fetching the sample rate while in single shot mode doesn't take
an argument so the snprintf here is redundant.

hardware/hameg-hmo/protocol.c

index cb751c53d6f50960c8aef521fb37152b3bf24cd0..ff9cf29ff2b84407499f21f8f52df2df890b5aa5 100644 (file)
@@ -453,11 +453,11 @@ SR_PRIV int hmo_update_sample_rate(const struct sr_dev_inst *sdi)
        /* No channel is active, ask the instrument for the sample rate
         * in single shot mode */
        if (!channel_found) {
-               g_snprintf(tmp_str, sizeof(tmp_str),
-                          (*config->scpi_dialect)[SCPI_CMD_GET_SAMPLE_RATE]);
-
-               if (sr_scpi_get_float(sdi->conn, tmp_str, &tmp_float) != SR_OK)
+               if (sr_scpi_get_float(sdi->conn,
+                                     (*config->scpi_dialect)[SCPI_CMD_GET_SAMPLE_RATE],
+                                     &tmp_float) != SR_OK)
                        return SR_ERR;
+
                state->sample_rate = tmp_float;
        } else {
                if (sr_scpi_get_int(sdi->conn, tmp_str, &tmp) != SR_OK)