From 8017245714fb43b422db3519fb26129b47d139e3 Mon Sep 17 00:00:00 2001 From: Stas Degteff Date: Wed, 19 Oct 2011 23:31:31 +0000 Subject: [PATCH] Improve diagnostic of crash --- golded3/gemlst.cpp | 4 ---- goldlib/gall/gstrutil.cpp | 7 ++++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/golded3/gemlst.cpp b/golded3/gemlst.cpp index b1fc529..c9d5d14 100644 --- a/golded3/gemlst.cpp +++ b/golded3/gemlst.cpp @@ -306,8 +306,6 @@ void GMsgList::print_line(uint idx, uint pos, bool isbar) { int tosiz = mlst_tosiz + fldadd1; int resiz = mlst_resiz + fldadd2; - GFTRK("GMsgList::print_line"); - ReadMlst(idx); MLst* ml = mlst[idx]; @@ -392,8 +390,6 @@ void GMsgList::print_line(uint idx, uint pos, bool isbar) { } goldmark = ml->goldmark; - - GFTRK(0); } diff --git a/goldlib/gall/gstrutil.cpp b/goldlib/gall/gstrutil.cpp index 63a79ef..c91303c 100644 --- a/goldlib/gall/gstrutil.cpp +++ b/goldlib/gall/gstrutil.cpp @@ -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. { 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(); } else if (ret >= sizeOfBuffer)