OSDN Git Service
(root)
/
android-x86
/
system-extras.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3669b3f
)
Cleanup uses of sprintf so we can deprecate it.
author
George Burgess IV
<gbiv@google.com>
Wed, 2 Mar 2016 22:15:49 +0000
(14:15 -0800)
committer
George Burgess IV
<gbiv@google.com>
Wed, 2 Mar 2016 22:15:49 +0000
(14:15 -0800)
Change-Id: I3ed15a7c261adf01c310bb58ff7ce836ea400bba
libfec/fec_read.cpp
patch
|
blob
|
history
diff --git
a/libfec/fec_read.cpp
b/libfec/fec_read.cpp
index
2d29da8
..
0f5ec99
100644
(file)
--- 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];