am 8a14d8b9: am 1a5b6098: Handle GET_POWER failures

* commit '8a14d8b9c03c611cabde5743cfdcc9ff51314550':
  Handle GET_POWER failures
This commit is contained in:
Irfan Sheriff
2011-05-04 21:19:19 -07:00
committed by Android Git Automerger

View File

@@ -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
// number we're interested in.
sscanf(reply, "%*s = %u", &power);
if (sscanf(reply, "%*s = %u", &power) != 1) {
return (jint)-1;
}
return (jint)power;
}