summaryrefslogtreecommitdiff
path: root/libfec
diff options
context:
space:
mode:
authorGeorge Burgess IV <gbiv@google.com>2016-03-02 14:15:49 -0800
committerGeorge Burgess IV <gbiv@google.com>2016-03-02 14:15:49 -0800
commitac4f7e7b9cde2f1e71efa0b7dd4b842bb0624b8c (patch)
treeeac39508fc36907bc255ef6ef273b3b53d8cef10 /libfec
parent3669b3f331485fec4a304177b8a80a25efd1f7d8 (diff)
downloadextras-ac4f7e7b9cde2f1e71efa0b7dd4b842bb0624b8c.tar.gz
Cleanup uses of sprintf so we can deprecate it.
Change-Id: I3ed15a7c261adf01c310bb58ff7ce836ea400bba
Diffstat (limited to 'libfec')
-rw-r--r--libfec/fec_read.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libfec/fec_read.cpp b/libfec/fec_read.cpp
index 2d29da8e..0f5ec998 100644
--- a/libfec/fec_read.cpp
+++ b/libfec/fec_read.cpp
@@ -47,7 +47,9 @@ static void dump(const char *name, uint64_t value, const uint8_t *data,
for (size_t m = 0; m < bytes_per_line; ++m) {
if (n + m < size) {
- sprintf(&hex[m * 3], "%02x ", data[n + m]);
+ ptrdiff_t offset = &hex[m * 3] - hex;
+ snprintf(hex + offset, sizeof(hex) - offset, "%02x ",
+ data[n + m]);
if (isprint(data[n + m])) {
prn[m] = data[n + m];