| 1 | diff -up plib-1.8.5/src/ssg/ssgParser.cxx~ plib-1.8.5/src/ssg/ssgParser.cxx
|
| 2 | |
| 3 | |
| 4 | @@ -57,18 +57,16 @@ void _ssgParser::error( const char *form
|
| 5 | char msgbuff[ 255 ];
|
| 6 | va_list argp;
|
| 7 |
|
| 8 | - char* msgptr = msgbuff;
|
| 9 | - if (linenum)
|
| 10 | - {
|
| 11 | - msgptr += sprintf ( msgptr,"%s, line %d: ",
|
| 12 | - path, linenum );
|
| 13 | - }
|
| 14 | -
|
| 15 | va_start( argp, format );
|
| 16 | - vsprintf( msgptr, format, argp );
|
| 17 | + vsnprintf( msgbuff, sizeof(msgbuff), format, argp );
|
| 18 | va_end( argp );
|
| 19 |
|
| 20 | - ulSetError ( UL_WARNING, "%s", msgbuff ) ;
|
| 21 | + if (linenum)
|
| 22 | + {
|
| 23 | + ulSetError ( UL_WARNING, "%s, line %d: %s", path, linenum, msgbuff ) ;
|
| 24 | + } else {
|
| 25 | + ulSetError ( UL_WARNING, "%s", msgbuff ) ;
|
| 26 | + }
|
| 27 | }
|
| 28 |
|
| 29 |
|
| 30 | @@ -78,18 +76,16 @@ void _ssgParser::message( const char *fo
|
| 31 | char msgbuff[ 255 ];
|
| 32 | va_list argp;
|
| 33 |
|
| 34 | - char* msgptr = msgbuff;
|
| 35 | - if (linenum)
|
| 36 | - {
|
| 37 | - msgptr += sprintf ( msgptr,"%s, line %d: ",
|
| 38 | - path, linenum );
|
| 39 | - }
|
| 40 | -
|
| 41 | va_start( argp, format );
|
| 42 | - vsprintf( msgptr, format, argp );
|
| 43 | + vsnprintf( msgbuff, sizeof(msgbuff), format, argp );
|
| 44 | va_end( argp );
|
| 45 |
|
| 46 | - ulSetError ( UL_DEBUG, "%s", msgbuff ) ;
|
| 47 | + if (linenum)
|
| 48 | + {
|
| 49 | + ulSetError ( UL_DEBUG, "%s, line %d: %s", path, linenum, msgbuff ) ;
|
| 50 | + } else {
|
| 51 | + ulSetError ( UL_DEBUG, "%s", msgbuff ) ;
|
| 52 | + }
|
| 53 | }
|
| 54 |
|
| 55 | // Opens the file and does a few internal calculations based on the spec.
|