Skip to content

Commit

Permalink
fix snprintf buffer allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
nmwsharp committed Jul 20, 2019
1 parent fd37b37 commit b201c3d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/polyscope/affine_remapper.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ inline T AffineRemapper<T>::map(const T& x) {

template <typename T>
std::string AffineRemapper<T>::printBounds() {
size_t bSize = 50;
char b[bSize];
snprintf(b, bSize, "[%6.2e, %6.2e]", minVal, maxVal);
return std::string(b);
const size_t bSize = 32;
std::array<char, bSize> b;
snprintf(b.data(), bSize, "[%6.2e, %6.2e]", minVal, maxVal);
return std::string(b.data());
}

}; // namespace polyscope

0 comments on commit b201c3d

Please sign in to comment.