X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fsession_driver.c;h=c6af3b6dc04342fe136080f0315fef3ddf275696;hb=00ed77f27c85462cae238ee433dbf0f606eaaf84;hp=a102fdd7ee3a9affa0939e5c73ae64d1c577d0cb;hpb=95c1fe62f77d347bf173b1236c38a9043efabd2b;p=libsigrok.git diff --git a/src/session_driver.c b/src/session_driver.c index a102fdd7..c6af3b6d 100644 --- a/src/session_driver.c +++ b/src/session_driver.c @@ -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,