зеркало из https://github.com/mozilla/gecko-dev.git
Fix crash in the XML error reporter (and doing some cleanup), the format string for printf'ing out numbers should be %d, not %s! r=harishd@netscape.com
This commit is contained in:
Родитель
b691466a6b
Коммит
0e33a0e878
|
@ -730,15 +730,22 @@ nsresult CWellFormedDTD::HandleErrorToken(CToken* aToken) {
|
|||
|
||||
// Output the error to the console
|
||||
if (error) {
|
||||
char* temp;
|
||||
PR_fprintf(PR_STDOUT, "XML Error in file '%s', ",(temp = mFilename.ToNewCString()));
|
||||
Recycle(temp);
|
||||
PR_fprintf(PR_STDOUT, "Line Number: %s, ", error->lineNumber);
|
||||
PR_fprintf(PR_STDOUT, "Col Number: %s, ", error->colNumber);
|
||||
PR_fprintf(PR_STDOUT, "Description: %s\n",(temp = error->description.ToNewCString()));
|
||||
Recycle(temp);
|
||||
PR_fprintf(PR_STDOUT, "Source Line: %s\n",(temp = error->sourceLine.ToNewCString()));
|
||||
Recycle(temp);
|
||||
nsCAutoString temp;
|
||||
|
||||
temp.AssignWithConversion(mFilename);
|
||||
|
||||
PR_fprintf(PR_STDOUT, "XML Error in file '%s', ", temp.get());
|
||||
|
||||
PR_fprintf(PR_STDOUT, "Line Number: %d, ", error->lineNumber);
|
||||
PR_fprintf(PR_STDOUT, "Col Number: %d, ", error->colNumber);
|
||||
|
||||
temp.AssignWithConversion(error->description);
|
||||
|
||||
PR_fprintf(PR_STDOUT, "Description: %s\n", temp.get());
|
||||
|
||||
temp.AssignWithConversion(error->sourceLine);
|
||||
|
||||
PR_fprintf(PR_STDOUT, "Source Line: %s\n", temp.get());
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -730,15 +730,22 @@ nsresult CWellFormedDTD::HandleErrorToken(CToken* aToken) {
|
|||
|
||||
// Output the error to the console
|
||||
if (error) {
|
||||
char* temp;
|
||||
PR_fprintf(PR_STDOUT, "XML Error in file '%s', ",(temp = mFilename.ToNewCString()));
|
||||
Recycle(temp);
|
||||
PR_fprintf(PR_STDOUT, "Line Number: %s, ", error->lineNumber);
|
||||
PR_fprintf(PR_STDOUT, "Col Number: %s, ", error->colNumber);
|
||||
PR_fprintf(PR_STDOUT, "Description: %s\n",(temp = error->description.ToNewCString()));
|
||||
Recycle(temp);
|
||||
PR_fprintf(PR_STDOUT, "Source Line: %s\n",(temp = error->sourceLine.ToNewCString()));
|
||||
Recycle(temp);
|
||||
nsCAutoString temp;
|
||||
|
||||
temp.AssignWithConversion(mFilename);
|
||||
|
||||
PR_fprintf(PR_STDOUT, "XML Error in file '%s', ", temp.get());
|
||||
|
||||
PR_fprintf(PR_STDOUT, "Line Number: %d, ", error->lineNumber);
|
||||
PR_fprintf(PR_STDOUT, "Col Number: %d, ", error->colNumber);
|
||||
|
||||
temp.AssignWithConversion(error->description);
|
||||
|
||||
PR_fprintf(PR_STDOUT, "Description: %s\n", temp.get());
|
||||
|
||||
temp.AssignWithConversion(error->sourceLine);
|
||||
|
||||
PR_fprintf(PR_STDOUT, "Source Line: %s\n", temp.get());
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
Загрузка…
Ссылка в новой задаче