[Android] Drop unneeded initialization
Rafaël Carré
git at videolan.org
Tue Jan 28 14:57:38 CET 2014
vlc-ports/android | branch: master | Rafaël Carré <funman at videolan.org> | Tue Jan 28 14:42:32 2014 +0100| [819b48b46e605f03f65881c29da1a7586509865f] | committer: Rafaël Carré
Drop unneeded initialization
Protect against too large snprintf by using sizeof
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=819b48b46e605f03f65881c29da1a7586509865f
---
vlc-android/jni/libvlcjni.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/vlc-android/jni/libvlcjni.c b/vlc-android/jni/libvlcjni.c
index 4e3c6f9..c791cd6 100644
--- a/vlc-android/jni/libvlcjni.c
+++ b/vlc-android/jni/libvlcjni.c
@@ -228,15 +228,15 @@ void Java_org_videolan_libvlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz)
methodId = (*env)->GetMethodID(env, cls, "getDeblocking", "()I");
int deblocking = (*env)->CallIntMethod(env, thiz, methodId);
- char deblockstr[2] = "3";
- snprintf(deblockstr, 2, "%d", deblocking);
+ char deblockstr[2];
+ snprintf(deblockstr, sizeof(decblockstr), "%d", deblocking);
LOGD("Using deblocking level %d", deblocking);
methodId = (*env)->GetMethodID(env, cls, "getNetworkCaching", "()I");
int networkCaching = (*env)->CallIntMethod(env, thiz, methodId);
- char networkCachingstr[25] = "0";
+ char networkCachingstr[25];
if(networkCaching > 0) {
- snprintf(networkCachingstr, 25, "--network-caching=%d", networkCaching);
+ snprintf(networkCachingstr, sizeof(networkCachingstr), "--network-caching=%d", networkCaching);
LOGD("Using network caching of %d ms", networkCaching);
}
More information about the Android
mailing list