Replace sscanf with PR_sscanf (bug 197760), patch by Roland.Mainz@informatik.med.uni-giessen.de, r=jkeiser@netscape.com, sr=bzbarsky@mit.edu
This commit is contained in:
Родитель
365c2f0f6c
Коммит
809cf0df08
|
@ -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)
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
#include "nsIDOMWindowInternal.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsSupportsArray.h"
|
||||
#include "prprf.h"
|
||||
|
||||
// For Prefs
|
||||
#include "nsIPrefBranch.h"
|
||||
|
@ -1099,7 +1100,7 @@ nsresult nsPrintOptions::ReadPrefDouble(const char * aPrefId,
|
|||
nsresult rv = mPrefBranch->GetCharPref(aPrefId, &str);
|
||||
if (NS_SUCCEEDED(rv) && str) {
|
||||
float f;
|
||||
sscanf(str, "%f", &f);
|
||||
PR_sscanf(str, "%f", &f);
|
||||
aVal = double(f);
|
||||
nsMemory::Free(str);
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include "nsIComponentManager.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsCRT.h"
|
||||
#include "prprf.h"
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
|
@ -432,7 +433,7 @@ nsLocaleService::GetLocaleFromAcceptLanguage(const char *acceptLanguage, nsILoca
|
|||
qvalue[countLang] = 1.0f;
|
||||
/* add extra parens to get rid of warning */
|
||||
if ((cPtr1 = strchr(cPtr,';')) != nsnull) {
|
||||
sscanf(cPtr1,";q=%f",&qvalue[countLang]);
|
||||
PR_sscanf(cPtr1,";q=%f",&qvalue[countLang]);
|
||||
*cPtr1 = '\0';
|
||||
}
|
||||
if (strlen(cPtr)<NSILOCALE_MAX_ACCEPT_LANGUAGE) { /* ignore if too long */
|
||||
|
|
Загрузка…
Ссылка в новой задаче