time /= 1000;
if ((ibuf - i) >= packet_size) {
+ GString *text;
/* We have at least a packet's worth of data. */
+ text = sr_hexdump_new(&buf[i], packet_size);
+ sr_spew("Trying packet: %s", text->str);
+ sr_hexdump_free(text);
if (is_valid(&buf[i])) {
sr_spew("Found valid %zu-byte packet after "
"%" PRIu64 "ms.", (ibuf - i), time);
if (!name)
return NULL;
- serial = g_malloc(sizeof(struct sr_serial_port));
+ serial = g_malloc0(sizeof(*serial));
serial->name = g_strdup(name);
serial->description = g_strdup(description ? description : "");