am 1a5b6098: Handle GET_POWER failures

* commit '1a5b6098d5002ae07ce3f9bc514400a87c2b64fa':
  Handle GET_POWER failures
This commit is contained in:
Irfan Sheriff
2011-05-04 21:14:47 -07:00
committed by Android Git Automerger

View File

@@ -402,7 +402,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;
}