mirror of
https://gitee.com/openharmony/applications_settings
synced 2024-11-27 00:20:59 +00:00
!773 [Bug]: fix ffi getValue
Merge pull request !773 from dinghong/fix_settings
This commit is contained in:
commit
c2985a818c
@ -52,11 +52,10 @@ char* TransformFromString(std::string str, int32_t* ret)
|
||||
|
||||
bool CheckoutStatus(int32_t status, int32_t* result)
|
||||
{
|
||||
*result = 0;
|
||||
if (status >= 0) {
|
||||
*result = 0;
|
||||
return true;
|
||||
}
|
||||
*result = status;
|
||||
if (status == PERMISSION_DENIED_CODE) {
|
||||
*result = PERMISSION_EXCEPTION_CODE;
|
||||
}
|
||||
@ -265,6 +264,9 @@ char* Settings::GetValue(
|
||||
int64_t len = info.value.size();
|
||||
if (len <= 0) {
|
||||
CheckoutStatus(info.status, ret);
|
||||
if (*ret == 0) {
|
||||
return TransformFromString(value, ret);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
return TransformFromString(info.value, ret);
|
||||
|
Loading…
Reference in New Issue
Block a user