diff options
author | Marco Paland <marco@paland.com> | 2019-01-16 10:44:13 +0100 |
---|---|---|
committer | Marco Paland <marco@paland.com> | 2019-01-16 10:44:13 +0100 |
commit | c013a0e8d6bb57247074c748a05bbe7f43bdec6f (patch) | |
tree | 09e806a56f9128c913c0925ef99d8ba5fb156d19 /test | |
parent | d974b16eacb5bdfdbbecf15d512a68c1bc23c743 (diff) | |
download | printf-c013a0e8d6bb57247074c748a05bbe7f43bdec6f.tar.gz printf-c013a0e8d6bb57247074c748a05bbe7f43bdec6f.tar.bz2 printf-c013a0e8d6bb57247074c748a05bbe7f43bdec6f.zip |
fix(printf): fctprintf() must not append null terminator
Fixes #39, references #19
Diffstat (limited to 'test')
-rw-r--r-- | test/test_suite.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/test_suite.cpp b/test/test_suite.cpp index bcddd4f..100b59f 100644 --- a/test/test_suite.cpp +++ b/test/test_suite.cpp @@ -69,7 +69,8 @@ TEST_CASE("fctprintf", "[]" ) { printf_idx = 0U;
memset(printf_buffer, 0xCC, 100U);
test::fctprintf(&_out_fct, nullptr, "This is a test of %X", 0x12EFU);
- REQUIRE(!strcmp(printf_buffer, "This is a test of 12EF"));
+ REQUIRE(!strncmp(printf_buffer, "This is a test of 12EF", 22U));
+ REQUIRE(printf_buffer[22] == (char)0xCC);
}
|