From c2e0c7a8fa97c19d595cc345e7c4fdf5a8d06ee7 Mon Sep 17 00:00:00 2001 From: chuxuezhe11 Date: Tue, 27 Jul 2021 02:39:51 +0000 Subject: [PATCH] fix the bug for stoull to the non numeric string --- bin/src/bytrace_impl.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/src/bytrace_impl.cpp b/bin/src/bytrace_impl.cpp index 59f5629..5ae33e1 100755 --- a/bin/src/bytrace_impl.cpp +++ b/bin/src/bytrace_impl.cpp @@ -75,10 +75,9 @@ bool IsAppValid() uint64_t GetSysParamTags() { // Get the system parameters of KEY_TRACE_TAG. - std::string tagStr = OHOS::system::GetParameter(KEY_TRACE_TAG, ""); - uint64_t tags = std::stoull(tagStr); - if (tagStr == "" || tags == ULLONG_MAX) { - fprintf(stderr, "GetSysParamTags error tag: %s.\n", tagStr.c_str()); + uint64_t tags = OHOS::system::GetUintParameter(KEY_TRACE_TAG, 0); + if (tags == 0) { + fprintf(stderr, "GetUintParameter %s error.\n", KEY_TRACE_TAG.c_str()); return 0; }