Skip to content

Commit

Permalink
Correct the push_back method name.
Browse files Browse the repository at this point in the history
* Used `GetObjectField` instead of `GetField` since there is no method available in `jni.h`.
  • Loading branch information
MohitMaliDeveloper committed Apr 20, 2024
1 parent c729665 commit cb65ec2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/main/cpp/libzim/archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ zim::FdInput jni2fdInput(const jobject& fdInputObj, JNIEnv* env)
{
jclass class_fdesc = env->FindClass("org/kiwix/FdInput");
jfieldID field_id = env->GetFieldID(class_fdesc, "fd", "java/io/FileDescriptor");
jobject fdObj = env->GetField(fdInputObj, field_id);
jobject fdObj = env->GetObjectField(fdInputObj, field_id);
int fd = jni2fd(fdObj, env);

field_id = env->GetFieldID(class_fdesc, "offset", "J");
Expand Down Expand Up @@ -153,7 +153,7 @@ JNIEXPORT void JNICALL Java_org_kiwix_libzim_Archive_setNativeArchiveEmbeddedFds
for(i = 0; i<length; i++) {
jobject fdObj = env->GetObjectArrayElement(fdsObj, i);
auto fdInput = jni2fdInput(fdObj, env);
v.push_pack(fdInput);
v.push_back(fdInput);
}

try {
Expand Down

0 comments on commit cb65ec2

Please sign in to comment.