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:
jst%netscape.com 2001-01-09 19:54:37 +00:00
Родитель b691466a6b
Коммит 0e33a0e878
2 изменённых файлов: 32 добавлений и 18 удалений

Просмотреть файл

@ -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;