$NetBSD: patch-ay,v 1.2 2002/08/25 19:23:53 jlam Exp $ --- kdoctools/xslt.cpp.orig Wed May 8 19:27:41 2002 +++ kdoctools/xslt.cpp @@ -52,18 +52,18 @@ va_list args; - char buffer[50000]; +#define WF_BUFSIZE 50000 + char buffer[WF_BUFSIZE]; buffer[0] = 0; if (input->filename) { - sprintf(&buffer[strlen(buffer)], "%s:%d: ", input->filename, - input->line); + snprintf(buffer, WF_BUFSIZE, "%s:%d: ", input->filename, input->line); } else { - sprintf(&buffer[strlen(buffer)], "Entity: line %d: ", input->line); + snprintf(buffer, WF_BUFSIZE, "Entity: line %d: ", input->line); } va_start(args, msg); - vsprintf(&buffer[strlen(buffer)], msg, args); + vsnprintf(&buffer[strlen(buffer)], WF_BUFSIZE, msg, args); va_end(args); fprintf( stderr, "%s", buffer ); @@ -89,9 +89,10 @@ INFO(i18n("Reading document")); QFile xmlFile( pat ); xmlFile.open(IO_ReadOnly); + + int len = xmlFile.size(); QCString contents; contents.assign(xmlFile.readAll()); - contents.truncate(xmlFile.size()); xmlFile.close(); /* if (contents.left(5) != "sax->warning = warningsFunc; int directory = pat.findRev('/');