DNP: avoid a divide-by-zero error if we encounter unknown media.

This commit is contained in:
Solomon Peachy 2016-09-06 17:19:36 -04:00
parent 46e795ebe1
commit 7b52082af7
1 changed files with 5 additions and 5 deletions

View File

@ -714,7 +714,7 @@ static void dnpds40_attach(void *vctx, struct libusb_device_handle *dev,
ctx->media_count_new = 180;
break;
default:
ctx->media_count_new = 0;
ctx->media_count_new = 999; // non-zero
}
break;
case P_DNP_DSRX1:
@ -726,7 +726,7 @@ static void dnpds40_attach(void *vctx, struct libusb_device_handle *dev,
ctx->media_count_new = 350;
break;
default:
ctx->media_count_new = 0;
ctx->media_count_new = 999; // non-zero
}
break;
case P_DNP_DS80:
@ -739,11 +739,11 @@ static void dnpds40_attach(void *vctx, struct libusb_device_handle *dev,
ctx->media_count_new = 110;
break;
default:
ctx->media_count_new = 0;
ctx->media_count_new = 999; // non-zero
}
break;
default:
ctx->media_count_new = 0;
ctx->media_count_new = 999; // non-zero
break;
}
}
@ -2211,7 +2211,7 @@ static int dnpds40_cmdline_arg(void *vctx, int argc, char **argv)
/* Exported */
struct dyesub_backend dnpds40_backend = {
.name = "DNP DS40/DS80/DSRX1/DS620",
.version = "0.87",
.version = "0.88",
.uri_prefix = "dnpds40",
.cmdline_usage = dnpds40_cmdline,
.cmdline_arg = dnpds40_cmdline_arg,