diff options
author | Irfan Sheriff <isheriff@google.com> | 2011-05-04 21:19:19 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-05-04 21:19:19 -0700 |
commit | 86654eda96b005ea21bfe4d29cd042187e497a8f (patch) | |
tree | 793f12085d65b2d08e5382f043583980eaf82954 /core/jni/android_net_wifi_Wifi.cpp | |
parent | ece6eb5625ac8b597f60d67f30f431ea13f237a5 (diff) | |
parent | 8a14d8b9c03c611cabde5743cfdcc9ff51314550 (diff) | |
download | frameworks_base-86654eda96b005ea21bfe4d29cd042187e497a8f.zip frameworks_base-86654eda96b005ea21bfe4d29cd042187e497a8f.tar.gz frameworks_base-86654eda96b005ea21bfe4d29cd042187e497a8f.tar.bz2 |
am 8a14d8b9: am 1a5b6098: Handle GET_POWER failures
* commit '8a14d8b9c03c611cabde5743cfdcc9ff51314550':
Handle GET_POWER failures
Diffstat (limited to 'core/jni/android_net_wifi_Wifi.cpp')
-rw-r--r-- | core/jni/android_net_wifi_Wifi.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/jni/android_net_wifi_Wifi.cpp b/core/jni/android_net_wifi_Wifi.cpp index 667ba75..4e363bf 100644 --- a/core/jni/android_net_wifi_Wifi.cpp +++ b/core/jni/android_net_wifi_Wifi.cpp @@ -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; } |