Improve diagnostic of crash

This commit is contained in:
Stas Degteff 2011-10-19 23:31:31 +00:00
parent bb57161a23
commit 8017245714
2 changed files with 6 additions and 5 deletions

View File

@ -306,8 +306,6 @@ void GMsgList::print_line(uint idx, uint pos, bool isbar) {
int tosiz = mlst_tosiz + fldadd1; int tosiz = mlst_tosiz + fldadd1;
int resiz = mlst_resiz + fldadd2; int resiz = mlst_resiz + fldadd2;
GFTRK("GMsgList::print_line");
ReadMlst(idx); ReadMlst(idx);
MLst* ml = mlst[idx]; MLst* ml = mlst[idx];
@ -392,8 +390,6 @@ void GMsgList::print_line(uint idx, uint pos, bool isbar) {
} }
goldmark = ml->goldmark; goldmark = ml->goldmark;
GFTRK(0);
} }

View File

@ -804,7 +804,12 @@ int gsprintf(TCHAR* buffer, size_t sizeOfBuffer, const TCHAR* __file, int __line
if (ret < 0) // Until glibc 2.0.6 vsnprintf() would return -1 when the output was truncated. if (ret < 0) // Until glibc 2.0.6 vsnprintf() would return -1 when the output was truncated.
{ {
LOG.errtest(__file, __line); LOG.errtest(__file, __line);
LOG.printf("! gsprintf(buffer,%i,%s,...): vsnprintf() error: \"%s\".", sizeOfBuffer, format, strerror(errno)); char * errstring = strerror(errno);
LOG.printf("! gsprintf(buffer,%i,%s,...): vsnprintf() error: \"%s\".", sizeOfBuffer, format, errstring);
if ( strcmp(errstring, "Invalid or incomplete multibyte or wide character")==0 )
{
LOG.printf("! Possible reason: you don't set locale properly");
}
TestErrorExit(); TestErrorExit();
} }
else if (ret >= sizeOfBuffer) else if (ret >= sizeOfBuffer)