Replace sscanf with PR_sscanf (bug 197760), patch by Roland.Mainz@informatik.med.uni-giessen.de, r=jkeiser@netscape.com, sr=bzbarsky@mit.edu
git-svn-id: svn://10.0.0.236/trunk@139751 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -210,7 +210,7 @@ mozSqlConnectionPgsql::RealExec(const nsAString& aQuery,
|
||||
else if (stat == PGRES_COMMAND_OK) {
|
||||
if (!aAffectedRows)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
sscanf(PQcmdTuples(r), "%d", aAffectedRows);
|
||||
PR_sscanf(PQcmdTuples(r), "%d", aAffectedRows);
|
||||
mLastID = PQoidValue(r);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
|
||||
#include "prprf.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "mozSqlResultPgsql.h"
|
||||
|
||||
@@ -38,7 +40,7 @@ mozSqlResultPgsql::GetColType(PRInt32 aColumnIndex)
|
||||
for (PRInt32 i = 0; i < PQntuples(mTypes); i++) {
|
||||
char* value = PQgetvalue(mTypes, i, 0);
|
||||
PRInt32 o;
|
||||
sscanf(value, "%d", &o);
|
||||
PR_sscanf(value, "%d", &o);
|
||||
if (o == oid) {
|
||||
char* type = PQgetvalue(mTypes, i, 1);
|
||||
if (! strcmp(type, "int2"))
|
||||
@@ -106,11 +108,11 @@ mozSqlResultPgsql::BuildRows()
|
||||
if (type == mozISqlResult::TYPE_STRING)
|
||||
cell->SetString(ToNewUnicode(NS_ConvertUTF8toUCS2(value)));
|
||||
else if (type == mozISqlResult::TYPE_INT)
|
||||
sscanf(value, "%d", &cell->mInt);
|
||||
PR_sscanf(value, "%d", &cell->mInt);
|
||||
else if (type == mozISqlResult::TYPE_FLOAT)
|
||||
sscanf(value, "%f", &cell->mFloat);
|
||||
PR_sscanf(value, "%f", &cell->mFloat);
|
||||
else if (type == mozISqlResult::TYPE_DECIMAL)
|
||||
sscanf(value, "%f", &cell->mFloat);
|
||||
PR_sscanf(value, "%f", &cell->mFloat);
|
||||
else if (type == mozISqlResult::TYPE_DATE ||
|
||||
type == mozISqlResult::TYPE_TIME ||
|
||||
type == mozISqlResult::TYPE_DATETIME)
|
||||
|
||||
Reference in New Issue
Block a user