]> sigrok.org Git - libsigrok.git/blobdiff - input/input_binary.c
sr/srd: Fix left-over #includes.
[libsigrok.git] / input / input_binary.c
index fd23bfc1b3898cd71d4dc5be2db35afa47b4de2f..9d7e1560a4dbcdd0187c3a0222baeeea765f9ab6 100644 (file)
@@ -23,7 +23,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <sys/time.h>
-#include <sigrok.h>
+#include "sigrok.h"
 
 #define CHUNKSIZE          4096
 #define DEFAULT_NUM_PROBES    8
@@ -40,22 +40,23 @@ static int format_match(const char *filename)
 static int init(struct sr_input *in)
 {
        int num_probes, i;
-       char name[SR_MAX_PROBENAME_LEN];
+       char name[SR_MAX_PROBENAME_LEN + 1];
 
        if (in->param && in->param[0]) {
                num_probes = strtoul(in->param, NULL, 10);
                if (num_probes < 1)
                        return SR_ERR;
-       } else
+       } else {
                num_probes = DEFAULT_NUM_PROBES;
+       }
 
-       /* create a virtual device */
+       /* Create a virtual device. */
        in->vdevice = sr_device_new(NULL, 0);
 
-       for (i = 0; i < num_probes; i++)
-       {
+       for (i = 0; i < num_probes; i++) {
                snprintf(name, SR_MAX_PROBENAME_LEN, "%d", i);
-               sr_device_probe_add(in->vdevice, name); /* TODO: Check return value. */
+               /* TODO: Check return value. */
+               sr_device_probe_add(in->vdevice, name);
        }
 
        return SR_OK;