diff options
author | George Burgess IV <gbiv@google.com> | 2016-02-24 15:55:54 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2016-02-24 20:59:20 -0800 |
commit | 2dcca6feb91fd917e26c4989af6400de904466a2 (patch) | |
tree | c6db610b309c2af3426e5ceb025facb8c97cf58e | |
parent | 2cb02c295dcd3cabf18d3384d9b12319e60dc974 (diff) | |
download | platform_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 |
Convert a few instances of sprintf to snprintf.android-wear-n-preview-2android-wear-n-preview-1android-wear-7.1.1_r1android-n-preview-5android-n-preview-4android-n-preview-3android-n-preview-2android-n-preview-1android-n-mr1-preview-2android-n-mr1-preview-1android-n-iot-preview-2nougat-mr1-wear-releasen-iot-preview-2
Change-Id: Ib3cdf8c3c817adc0eea0095ca4ef5fd66c8456b0
-rw-r--r-- | clatd_test.cpp | 8 |
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" |