* commit '8a14d8b9c03c611cabde5743cfdcc9ff51314550': Handle GET_POWER failures
This commit is contained in:
@@ -459,7 +459,9 @@ static jint android_net_wifi_getPowerModeCommand(JNIEnv* env, jobject clazz)
|
|||||||
}
|
}
|
||||||
// reply comes back in the form "powermode = XX" where XX is the
|
// reply comes back in the form "powermode = XX" where XX is the
|
||||||
// number we're interested in.
|
// number we're interested in.
|
||||||
sscanf(reply, "%*s = %u", &power);
|
if (sscanf(reply, "%*s = %u", &power) != 1) {
|
||||||
|
return (jint)-1;
|
||||||
|
}
|
||||||
return (jint)power;
|
return (jint)power;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user