diff --git a/include/report.cpp b/include/report.cpp index 5887e57fc..094033ec3 100755 --- a/include/report.cpp +++ b/include/report.cpp @@ -1566,12 +1566,12 @@ int TReport_field::compare(const TSortable& s) const { const TReport_field& rf = (TReport_field&)s; - int cmp = _rct.y - rf._rct.y; + int cmp = _id - rf._id; if (cmp == 0) { - cmp = _rct.x - rf._rct.x; + cmp = _rct.y - rf._rct.y; if (cmp == 0) - cmp = _id - rf._id; + cmp = _rct.x - rf._rct.x; } return cmp; } diff --git a/include/strings.cpp b/include/strings.cpp index 7409e77fd..3b7f7dcb3 100755 --- a/include/strings.cpp +++ b/include/strings.cpp @@ -26,7 +26,6 @@ TString& user() { static TString8 _user; - return _user; } @@ -857,7 +856,12 @@ TString& TString::format( char spark[512]; va_list pars; va_start(pars, fmt); + +#ifdef WIN32 + const unsigned int tot = _vsnprintf(spark, sizeof(spark), fmt, pars); +#else const unsigned int tot = vsprintf(spark, fmt, pars); +#endif va_end(pars); CHECK(tot < sizeof(spark), "Ue'! Quanto scrivi?"); @@ -1040,7 +1044,11 @@ TString& TFixed_string::format( { va_list pars; va_start(pars, fmt); +#ifdef WIN32 + const int tot = _vsnprintf(_str, size(), fmt, pars); +#else const int tot = vsprintf(_str, fmt, pars); +#endif va_end(pars); CHECK(tot >= 0 && tot <= size(), "Ue'! Quanto scrivi con 'sta format?"); return *this;