diff options
author | rouslan@chromium.org <rouslan@chromium.org> | 2014-08-26 17:11:37 +0000 |
---|---|---|
committer | rouslan@chromium.org <rouslan@chromium.org> | 2014-08-26 17:11:37 +0000 |
commit | 945d96387a716d0d82b195fa69a5e9a701249517 (patch) | |
tree | c1fbdd207e801fc46f417a230898a7e5d2040a5d | |
parent | b52a2aeb63a28914850f3ed81cd7fd26ecdd4cdc (diff) | |
download | src-945d96387a716d0d82b195fa69a5e9a701249517.tar.gz |
Static cast the timestamp to long for serialization.
This patch static casts the timestamp to long for serialization of
timestamps on systems that that use long long time. That should be good
enough until 2037.
R=roubert@google.com
Review URL: https://codereview.appspot.com/132900045
git-svn-id: http://libaddressinput.googlecode.com/svn/trunk@334 38ededc0-08b8-5190-f2ac-b31f878777ad
-rw-r--r-- | cpp/src/validating_util.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cpp/src/validating_util.cc b/cpp/src/validating_util.cc index 084c09c..9356689 100644 --- a/cpp/src/validating_util.cc +++ b/cpp/src/validating_util.cc @@ -84,7 +84,8 @@ bool UnwrapHeader(const char* header_prefix, void ValidatingUtil::Wrap(time_t timestamp, std::string* data) { assert(data != NULL); char timestamp_string[2 + 3 * sizeof timestamp]; - int size = std::sprintf(timestamp_string, "%ld", timestamp); + int size = + std::sprintf(timestamp_string, "%ld", static_cast<long>(timestamp)); assert(size > 0); assert(size < sizeof timestamp_string); (void)size; |