]> sigrok.org Git - libsigrok.git/blobdiff - src/input/binary.c
drivers/input: Remove some hardcoded values.
[libsigrok.git] / src / input / binary.c
index 4984edb0b0aa37b9d8145cf9acda08e01ea981dd..013621373c71dd4eed995c19980fed76c1b13cbc 100644 (file)
@@ -29,9 +29,9 @@
 
 #define LOG_PREFIX "input/binary"
 
-#define MAX_CHUNK_SIZE        4096
-#define DEFAULT_NUM_CHANNELS  8
-#define DEFAULT_SAMPLERATE    0
+#define MAX_CHUNK_SIZE       4096
+#define DEFAULT_NUM_CHANNELS 8
+#define DEFAULT_SAMPLERATE   0
 
 struct context {
        gboolean started;
@@ -56,7 +56,7 @@ static int init(struct sr_input *in, GHashTable *options)
        inc->samplerate = g_variant_get_uint64(g_hash_table_lookup(options, "samplerate"));
 
        for (i = 0; i < num_channels; i++) {
-               snprintf(name, 16, "%d", i);
+               snprintf(name, sizeof(name), "%d", i);
                sr_channel_new(in->sdi, i, SR_CHANNEL_LOGIC, TRUE, name);
        }