aboutsummaryrefslogtreecommitdiffstats
path: root/native/jni/src/proximity_info.cpp
diff options
context:
space:
mode:
authorKen Wakasa <kwakasa@google.com>2012-08-10 06:23:32 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-08-10 06:23:32 -0700
commit4ff0bccbe836ea569e7eb4f36d255ea09bb266cf (patch)
tree9c63ce56ba2c2698f01b38b2fa1322ab28a7ae6d /native/jni/src/proximity_info.cpp
parentbe03370d1e6ae45b138de0e36c436686eee08384 (diff)
parentec1e373a20e961d18dfd68db6b58c97c4da4176b (diff)
downloadlatinime-4ff0bccbe836ea569e7eb4f36d255ea09bb266cf.tar.gz
latinime-4ff0bccbe836ea569e7eb4f36d255ea09bb266cf.tar.xz
latinime-4ff0bccbe836ea569e7eb4f36d255ea09bb266cf.zip
am ec1e373a: am 063c3e21: Fix memset() bugs
* commit 'ec1e373a20e961d18dfd68db6b58c97c4da4176b': Fix memset() bugs
Diffstat (limited to 'native/jni/src/proximity_info.cpp')
-rw-r--r--native/jni/src/proximity_info.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/native/jni/src/proximity_info.cpp b/native/jni/src/proximity_info.cpp
index 2633913f7..18a0b74a8 100644
--- a/native/jni/src/proximity_info.cpp
+++ b/native/jni/src/proximity_info.cpp
@@ -34,7 +34,7 @@ static inline void safeGetOrFillZeroIntArrayRegion(JNIEnv *env, jintArray jArray
if (jArray && buffer) {
env->GetIntArrayRegion(jArray, 0, len, buffer);
} else if (buffer) {
- memset(buffer, 0, len);
+ memset(buffer, 0, len * sizeof(jint));
}
}
@@ -43,7 +43,7 @@ static inline void safeGetOrFillZeroFloatArrayRegion(JNIEnv *env, jfloatArray jA
if (jArray && buffer) {
env->GetFloatArrayRegion(jArray, 0, len, buffer);
} else if (buffer) {
- memset(buffer, 0, len);
+ memset(buffer, 0, len * sizeof(jfloat));
}
}