hello again

when i run
sigrok-cli --continuous --driver hantek-dso --output-format srzip
--output-file sigrok-cli.out
with my device that has no logic channels (only analog channels)
sigrok-cli crashes with

Thread 1 "sigrok-cli" received signal SIGFPE, Arithmetic exception.
_ in zip_create (o=_) at src/output/srzip.c:208
208   alloc_size /= outc->logic_buff.unit_size;

i replaced

  alloc_size /= outc->logic_buff.unit_size;

with

  if (outc->logic_buff.unit_size != 0) {
    alloc_size /= outc->logic_buff.unit_size;
  } else {
    alloc_size = 0;
  }

and i replaced

  send_size = length / buff->unit_size;

with

  if (buff->unit_size != 0) {
    send_size = length / buff->unit_size;
  } else {
    send_size = 0;
  }

and now its working fine


_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to