We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents dfc3b24 + e3da80f commit e8712e4Copy full SHA for e8712e4
1 file changed
cpp/src/validating_util.cc
@@ -84,8 +84,8 @@ bool UnwrapHeader(const char* header_prefix,
84
void ValidatingUtil::Wrap(time_t timestamp, std::string* data) {
85
assert(data != nullptr);
86
char timestamp_string[2 + 3 * sizeof timestamp];
87
- int size =
88
- std::sprintf(timestamp_string, "%ld", static_cast<long>(timestamp));
+ int size = std::snprintf(timestamp_string, sizeof(timestamp_string), "%ld",
+ static_cast<long>(timestamp));
89
assert(size > 0);
90
assert(size < sizeof timestamp_string);
91
(void)size;
0 commit comments