!1820 give udid a default value

Merge pull request !1820 from RingKing/master
This commit is contained in:
openharmony_ci 2023-03-09 14:08:39 +00:00 committed by Gitee
commit ed5e8f4dad
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -28,6 +28,7 @@ extern "C" {
int AclGetDevUdid(char *udid, int size)
{
const char* defaultVal = "1234567890";
if (udid == nullptr || size < UDID_LEN) {
return SYSPARAM_INVALID_INPUT;
}
@ -38,6 +39,8 @@ int AclGetDevUdid(char *udid, int size)
int ret = instance.GetUdid(result);
if (ret == 0) {
ret = strcpy_s(udid, size, result.c_str());
} else {
ret = strcpy_s(udid, size, defaultVal);
}
#else
int ret = GetDevUdid_(udid, size);