diff --git a/app/src/adb.c b/app/src/adb.c index 176f50b2..05516280 100644 --- a/app/src/adb.c +++ b/app/src/adb.c @@ -304,6 +304,10 @@ adb_get_serialno(struct sc_intr *intr) { return NULL; } + if (r == -1) { + return false; + } + sc_str_truncate(buf, r, " \r\n"); return strdup(buf);