]> git.stg.codes - stg.git/commitdiff
Fixed x2str for doubles.
authorMaxim Mamontov <faust.madf@gmail.com>
Thu, 29 May 2014 14:36:54 +0000 (17:36 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Thu, 29 May 2014 14:36:54 +0000 (17:36 +0300)
stglibs/common.lib/common.cpp

index 622f64f7f11b2b31fbb31d359fea6af743707dbc..c27a387d647949bbb8a27791c955bff6de10f3ee 100644 (file)
@@ -823,7 +823,8 @@ return unsigned2str(x, s);
 const std::string & x2str(double x, std::string & s)
 {
 char buf[256];
-s = snprintf(buf, sizeof(buf), "%f", x);
+snprintf(buf, sizeof(buf), "%f", x);
+s = buf;
 return s;
 }
 //---------------------------------------------------------------------------