summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Burgess IV <gbiv@google.com>2016-02-24 15:55:54 -0800
committerElliott Hughes <enh@google.com>2016-02-24 20:59:20 -0800
commit2dcca6feb91fd917e26c4989af6400de904466a2 (patch)
treec6db610b309c2af3426e5ceb025facb8c97cf58e
parent2cb02c295dcd3cabf18d3384d9b12319e60dc974 (diff)
downloadplatform_external_android-clat-nougat-mr1-wear-release.tar.gz
platform_external_android-clat-nougat-mr1-wear-release.tar.bz2
platform_external_android-clat-nougat-mr1-wear-release.zip
Change-Id: Ib3cdf8c3c817adc0eea0095ca4ef5fd66c8456b0
-rw-r--r--clatd_test.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clatd_test.cpp b/clatd_test.cpp
index 7e218f0..b901c30 100644
--- a/clatd_test.cpp
+++ b/clatd_test.cpp
@@ -379,12 +379,12 @@ void check_data_matches(const void *expected, const void *actual, size_t len, co
unsigned pos = 0;
for (unsigned i = 0; i < len; i++) {
if (i % 20 == 0) {
- sprintf(expected_hexdump + pos, "\n ");
- sprintf(actual_hexdump + pos, "\n ");
+ snprintf(expected_hexdump + pos, hexdump_len - pos, "\n ");
+ snprintf(actual_hexdump + pos, hexdump_len - pos, "\n ");
pos += 4;
}
- sprintf(expected_hexdump + pos, " %02x", ((uint8_t *) expected)[i]);
- sprintf(actual_hexdump + pos, " %02x", ((uint8_t *) actual)[i]);
+ snprintf(expected_hexdump + pos, hexdump_len - pos, " %02x", ((uint8_t *) expected)[i]);
+ snprintf(actual_hexdump + pos, hexdump_len - pos, " %02x", ((uint8_t *) actual)[i]);
pos += 3;
}
FAIL() << msg << ": Data doesn't match"