fixes for s.Printf(s) crashes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34843 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -326,8 +326,7 @@ int wxDbColFor::Format(int Nation, int dbDataType, SWORD sqlDataType,
|
|||||||
case DB_DATA_TYPE_FLOAT:
|
case DB_DATA_TYPE_FLOAT:
|
||||||
if (decimalDigits == 0)
|
if (decimalDigits == 0)
|
||||||
decimalDigits = 2;
|
decimalDigits = 2;
|
||||||
tempStr = wxT("%");
|
tempStr.Printf(wxT("%%%d.%d"), columnLength, decimalDigits);
|
||||||
tempStr.Printf(wxT("%s%d.%d"), tempStr.c_str(),columnLength, decimalDigits);
|
|
||||||
s_Field.Printf(wxT("%sf"), tempStr.c_str());
|
s_Field.Printf(wxT("%sf"), tempStr.c_str());
|
||||||
break;
|
break;
|
||||||
case DB_DATA_TYPE_DATE:
|
case DB_DATA_TYPE_DATE:
|
||||||
@@ -2438,7 +2437,7 @@ int wxDb::GetKeyFields(const wxString &tableName, wxDbColInf* colInf, UWORD noCo
|
|||||||
GetData( 5, SQL_C_SSHORT, &iKeySeq, 0, &cb);
|
GetData( 5, SQL_C_SSHORT, &iKeySeq, 0, &cb);
|
||||||
GetData( 7, SQL_C_WXCHAR, szFkTable, DB_MAX_TABLE_NAME_LEN+1, &cb);
|
GetData( 7, SQL_C_WXCHAR, szFkTable, DB_MAX_TABLE_NAME_LEN+1, &cb);
|
||||||
GetData( 8, SQL_C_WXCHAR, szFkCol, DB_MAX_COLUMN_NAME_LEN+1, &cb);
|
GetData( 8, SQL_C_WXCHAR, szFkCol, DB_MAX_COLUMN_NAME_LEN+1, &cb);
|
||||||
tempStr.Printf(wxT("%s[%s] "),tempStr.c_str(),szFkTable); // [ ] in case there is a blank in the Table name
|
tempStr << _T('[') << szFkTable << _T(']'); // [ ] in case there is a blank in the Table name
|
||||||
} // if
|
} // if
|
||||||
} // while
|
} // while
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user