Use "sprintf" instead of "snprintf" because cygwin doesn't support "snprintf"

This commit is contained in:
Soonho Kong 2013-09-15 01:38:21 -07:00
parent b553521578
commit dcc917a6b4

View file

@ -42,7 +42,7 @@ inline unsigned necessary_digits(mpfr_prec_t p) {
std::ostream & operator<<(std::ostream & out, mpfp const & v) { std::ostream & operator<<(std::ostream & out, mpfp const & v) {
char * s = nullptr; char * s = nullptr;
char format[128]; char format[128];
snprintf(format, sizeof(format), "%%.%dRNg", necessary_digits(mpfr_get_prec(v.m_val))); sprintf(format, "%%.%dRNg", necessary_digits(mpfr_get_prec(v.m_val))); // NOLINT
mpfr_asprintf(&s, format, v.m_val); mpfr_asprintf(&s, format, v.m_val);
std::string str = std::string(s); std::string str = std::string(s);
mpfr_free_str(s); mpfr_free_str(s);