From 560f33e2d88cc61422848b7d7328cb6c6fb7afed Mon Sep 17 00:00:00 2001 From: chuxuezhe11 Date: Wed, 21 Jul 2021 02:46:04 +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; }