]> sigrok.org Git - libsigrok.git/blobdiff - src/session_driver.c
SCPI: Ignore IDN header in *IDN? response
[libsigrok.git] / src / session_driver.c
index a5f2e36862681511518e5e9d77603f7edb129ae8..c6af3b6dc04342fe136080f0315fef3ddf275696 100644 (file)
@@ -92,7 +92,7 @@ static gboolean stream_session_data(struct sr_dev_inst *sdi)
                                sr_dbg("Opened %s.", vdev->capturefile);
                        } else {
                                /* Try as first chunk filename. */
-                               snprintf(capturefile, 15, "%s-1", vdev->capturefile);
+                               snprintf(capturefile, sizeof(capturefile) - 1, "%s-1", vdev->capturefile);
                                if (zip_stat(vdev->archive, capturefile, 0, &zs) != -1) {
                                        vdev->cur_chunk = 1;
                                        if (!(vdev->capfile = zip_fopen(vdev->archive,
@@ -108,7 +108,7 @@ static gboolean stream_session_data(struct sr_dev_inst *sdi)
                } else {
                        /* Capture data is chunked, advance to the next chunk. */
                        vdev->cur_chunk++;
-                       snprintf(capturefile, 15, "%s-%d", vdev->capturefile,
+                       snprintf(capturefile, sizeof(capturefile) - 1, "%s-%d", vdev->capturefile,
                                        vdev->cur_chunk);
                        if (zip_stat(vdev->archive, capturefile, 0, &zs) != -1) {
                                if (!(vdev->capfile = zip_fopen(vdev->archive,
@@ -250,8 +250,8 @@ static int dev_close(struct sr_dev_inst *sdi)
        return SR_OK;
 }
 
-static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
-               const struct sr_channel_group *cg)
+static int config_get(uint32_t key, GVariant **data,
+       const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
        struct session_vdev *vdev;
 
@@ -276,8 +276,8 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s
        return SR_OK;
 }
 
-static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
-               const struct sr_channel_group *cg)
+static int config_set(uint32_t key, GVariant *data,
+       const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
        struct session_vdev *vdev;
 
@@ -316,8 +316,8 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
        return SR_OK;
 }
 
-static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
-               const struct sr_channel_group *cg)
+static int config_list(uint32_t key, GVariant **data,
+       const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
        return STD_CONFIG_LIST(key, data, sdi, cg, NULL, NULL, devopts);
 }