Cleanup uses of sprintf so we can deprecate it.
Change-Id: I3ed15a7c261adf01c310bb58ff7ce836ea400bba
diff --git a/libfec/fec_read.cpp b/libfec/fec_read.cpp
index 2d29da8..0f5ec99 100644
--- a/libfec/fec_read.cpp
+++ b/libfec/fec_read.cpp
@@ -47,7 +47,9 @@
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];