aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Bentham <matthew.bentham@arm.com>2019-06-07 09:23:41 +0100
committerMatthew Bentham <matthew.bentham@arm.com>2019-06-07 10:50:34 +0000
commit49ab7ada17a354caa5b6263c3a732e55d9cd2743 (patch)
tree9baa1977ae65abe859aad357e565ba55f727b97f
parenta37e1bd2e9298360ef2481bea331c97ba65e3133 (diff)
downloadarmnn-49ab7ada17a354caa5b6263c3a732e55d9cd2743.tar.gz
Github #140 Use snprintf instead of strncpy
Change-Id: I4da3b390d60da76754bbab016a656fbaf37d7df5 Signed-off-by: Matthew Bentham <matthew.bentham@arm.com>
-rw-r--r--src/armnn/LayerSupport.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/armnn/LayerSupport.cpp b/src/armnn/LayerSupport.cpp
index 5324e5f2fe..1d9d249024 100644
--- a/src/armnn/LayerSupport.cpp
+++ b/src/armnn/LayerSupport.cpp
@@ -24,10 +24,7 @@ void CopyErrorMessage(char* truncatedString, const char* fullString, size_t maxL
{
if(truncatedString != nullptr)
{
- size_t copyLength = std::min(maxLength, strlen(fullString));
- std::strncpy(truncatedString, fullString, copyLength);
- // Ensure null-terminated string.
- truncatedString[copyLength] = '\0';
+ std::snprintf(truncatedString, maxLength, "%s", fullString);
}
}