summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index b873cdf..4c6e917 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -278,14 +278,18 @@ int doInit(CCOptionValue options[]) {
int setSerial(char *serialNumber, CCOptionValue options[]) {
struct ftdi_context *ftdi;
int f, ret = EXIT_FAILURE;
+ char *type = options[CCO_DeviceType].args;
+
+ if (!type) {
+ fprintf(stderr, "Device type not specified\n");
+ return EXIT_FAILURE;
+ }
ftdi = openDevice(options, NULL);
if (ftdi == NULL) {
return EXIT_FAILURE;
}
- char *type = options[CCO_DeviceType].args != NULL ? options[CCO_DeviceType].args : (char *)"sd-mux";
-
f = ftdi_eeprom_initdefaults(ftdi, (char *)"SRPOL", type, serialNumber);
if (f < 0) {
fprintf(stderr, "Unable to set eeprom strings: %d (%s)\n", f, ftdi_get_error_string(ftdi));