]> git.stg.codes - stg.git/blobdiff - stglibs/common.lib/common.cpp
Fixed x2str for doubles.
[stg.git] / stglibs / common.lib / common.cpp
index dab99605a71fe6a16d6c83db60a88f86825f4101..db2ff6b3e555e768127eb7943594b378cf4b4525 100644 (file)
@@ -793,7 +793,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;
 }
 //---------------------------------------------------------------------------