summaryrefslogtreecommitdiff
path: root/cpu_ref/rsCpuCore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpu_ref/rsCpuCore.cpp')
-rw-r--r--cpu_ref/rsCpuCore.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/cpu_ref/rsCpuCore.cpp b/cpu_ref/rsCpuCore.cpp
index 43e45218..f4f9c4c9 100644
--- a/cpu_ref/rsCpuCore.cpp
+++ b/cpu_ref/rsCpuCore.cpp
@@ -483,7 +483,7 @@ static const int kFormatInBytesMax = 16;
// ": " + 2 digits per byte + 1 separator between bytes + "..." + null
typedef char FormatBuf[2 + kFormatInBytesMax*2 + (kFormatInBytesMax - 1) + 3 + 1];
static const char *format_bytes(FormatBuf *outBuf, const uint8_t *inBuf, const int inBytes) {
- strcpy(*outBuf, ": ");
+ strlcpy(*outBuf, ": ", sizeof(FormatBuf));
int pos = 2;
const int lim = std::min(kFormatInBytesMax, inBytes);
for (int i = 0; i < lim; ++i) {
@@ -495,7 +495,7 @@ static const char *format_bytes(FormatBuf *outBuf, const uint8_t *inBuf, const i
pos += 2;
}
if (kFormatInBytesMax < inBytes)
- strcpy(*outBuf + pos, "...");
+ strlcpy(*outBuf + pos, "...", sizeof(FormatBuf) - pos);
return *outBuf;
}