Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Commit

Permalink
replace sprintf for ostringstream(#1192) (#1199)
Browse files Browse the repository at this point in the history
  • Loading branch information
lm-kajihara authored Sep 28, 2020
1 parent e0b50d9 commit 8804c87
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions blueoil/converter/templates/include/npy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,9 @@ struct Typestring {

public:
inline std::string str() {
const size_t max_buflen = 16;
char buf[max_buflen];
std::sprintf(buf, "%c%c%u", c_endian, c_type, len);
return std::string(buf);
std::ostringstream ss;
ss << c_endian << c_type << len;
return ss.str();
}

Typestring(const std::vector<float>& v)
Expand Down

0 comments on commit 8804c87

Please sign in to comment.