diff options
author | Clément Decoodt | 2023-03-01 10:09:51 +0100 |
---|---|---|
committer | Clément Decoodt | 2023-03-01 10:09:51 +0100 |
commit | d0cda199059ac9fba386a29827c91a5fed7c9cfc (patch) | |
tree | 3af5167c6d320d421d81271b8af641b35ed67808 /src | |
parent | dca3373850f5db6ecef77c99cd7c391037bc114e (diff) | |
download | usbmuxd-d0cda199059ac9fba386a29827c91a5fed7c9cfc.tar.gz usbmuxd-d0cda199059ac9fba386a29827c91a5fed7c9cfc.tar.bz2 |
Set default value for ENV_DEV_MODE
Fixes regression introduced in 84801d8 that removed the default value.
Diffstat (limited to 'src')
-rw-r--r-- | src/usb.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -690,7 +690,8 @@ static void get_mode_cb(struct libusb_transfer* transfer) unsigned char *data = libusb_control_transfer_get_data(transfer); - int desired_mode = atoi(getenv(ENV_DEVICE_MODE)); + char* desired_mode_char = getenv(ENV_DEVICE_MODE); + int desired_mode = desired_mode_char ? atoi(desired_mode_char) : 1; int guessed_mode = guess_mode(context->dev, dev); // Response is 3:3:3:0 for initial mode, 5:3:3:0 otherwise. |