diff --git a/interfaces/kits/js/src/mod_fs/properties/ani/listfile_ani.cpp b/interfaces/kits/js/src/mod_fs/properties/ani/listfile_ani.cpp index 43527ee474abfda13cfb1e53e14ccd918dac774f..6b65ec5ce49d8283d013b6cd76245bb157abb0dd 100644 --- a/interfaces/kits/js/src/mod_fs/properties/ani/listfile_ani.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/ani/listfile_ani.cpp @@ -114,10 +114,10 @@ tuple>> ParseArrayString(ani_env *env, ani_object } auto getterDesc = BuiltInTypes::Array::getterDesc.c_str(); auto getterSig = BuiltInTypes::Array::objectGetterSig.c_str(); - for (int i = 0; i < int(length); i++) { + for (int idx = 0; idx < int(length); idx++) { ani_ref stringEntryRef; if (ANI_OK != env->Object_CallMethodByName_Ref( - static_cast(resultRef), getterDesc, getterSig, &stringEntryRef, (ani_int)i)) { + static_cast(resultRef), getterDesc, getterSig, &stringEntryRef, (ani_int)idx)) { return { false, nullopt }; } auto [succ, tmp] = TypeConverter::ToUTF8String(env, static_cast(stringEntryRef));