From 27340f95e43ef6f756f4882844d8c42a10d3b78e Mon Sep 17 00:00:00 2001 From: tqchen Date: Sat, 25 Apr 2015 21:19:42 -0700 Subject: [PATCH] final minor --- include/dmlc/io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/dmlc/io.h b/include/dmlc/io.h index 1b7d70498..8caf2a1f7 100644 --- a/include/dmlc/io.h +++ b/include/dmlc/io.h @@ -303,7 +303,7 @@ inline void Stream::Write(const std::vector &vec) { uint64_t sz = static_cast(vec.size()); this->Write(&sz, sizeof(sz)); if (sz != 0) { - this->Write(&vec[0], sizeof(T) * sz); + this->Write(&vec[0], sizeof(T) * vec.size()); } } template @@ -320,7 +320,7 @@ inline void Stream::Write(const std::string &str) { uint64_t sz = static_cast(str.length()); this->Write(&sz, sizeof(sz)); if (sz != 0) { - this->Write(&str[0], sizeof(char) * sz); + this->Write(&str[0], sizeof(char) * str.length()); } } inline bool Stream::Read(std::string *out_str) {