summaryrefslogtreecommitdiff
path: root/ltunify.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltunify.c')
-rw-r--r--ltunify.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ltunify.c b/ltunify.c
index 1e685b4..9625776 100644
--- a/ltunify.c
+++ b/ltunify.c
@@ -1214,7 +1214,10 @@ int open_hidraw(void) {
if (pid == PID_NANO_RECEIVER_2) {
int iface = -1;
if ((fp = fopen_format("/sys/class/hidraw/%s/device/../bInterfaceNumber", dev_name))) {
- fscanf(fp, "%02x", &iface);
+ int m = fscanf(fp, "%02x", &iface);
+ if (m != 1) {
+ iface = -1;
+ }
fclose(fp);
}
if (iface == 0) {