diff options
author | Kirill Frolov <k.frolov@samsung.com> | 2019-12-17 14:12:40 +0300 |
---|---|---|
committer | Alexander Soldatov/AI Compiler Lab /SRR/Staff Engineer/Samsung Electronics <soldatov.a@samsung.com> | 2019-12-17 18:59:36 +0300 |
commit | 2da63a3662558979945ead590d4a1a70ec8e4d9c (patch) | |
tree | c099cd9da1b10d48be45142cead1c2907bb79e76 | |
parent | 37a9491baff3c892cb6f0e789e1ebeccd6bf155e (diff) | |
download | heaptrack-2da63a3662558979945ead590d4a1a70ec8e4d9c.tar.gz heaptrack-2da63a3662558979945ead590d4a1a70ec8e4d9c.tar.bz2 heaptrack-2da63a3662558979945ead590d4a1a70ec8e4d9c.zip |
Fixed warnings from static analyzer.
strncpy() replaced with snprintf().
-rw-r--r-- | profiler/profiler/src/profiler.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/profiler/profiler/src/profiler.cpp b/profiler/profiler/src/profiler.cpp index 1411577..e9e4386 100644 --- a/profiler/profiler/src/profiler.cpp +++ b/profiler/profiler/src/profiler.cpp @@ -1,3 +1,4 @@ +#include <stdio.h> #include "profiler.h" #include "pal_excerpts.h" #include "classfactory.h" @@ -94,8 +95,8 @@ StackEntry::StackEntry(unsigned int funcId, StackEntry *next) : m_funcId(funcId), m_isType(isType), m_next(next) { - strncpy(m_className, className, sizeof (m_className)); - strncpy(m_methodName, methodName, sizeof (m_methodName)); + snprintf(m_className, sizeof(m_className), "%s", className); + snprintf(m_methodName, sizeof(m_methodName), "%s", methodName); } void PushShadowStack(FunctionID functionId, char* className, char* methodName) |