You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.3 KiB
55 lines
1.3 KiB
9 years ago
|
--- plib-1.8.5/src/ssg/ssgParser.cxx~
|
||
|
+++ plib-1.8.5/src/ssg/ssgParser.cxx
|
||
|
@@ -57,18 +57,16 @@ void _ssgParser::error( const char *form
|
||
|
char msgbuff[ 255 ];
|
||
|
va_list argp;
|
||
|
|
||
|
- char* msgptr = msgbuff;
|
||
|
- if (linenum)
|
||
|
- {
|
||
|
- msgptr += sprintf ( msgptr,"%s, line %d: ",
|
||
|
- path, linenum );
|
||
|
- }
|
||
|
-
|
||
|
va_start( argp, format );
|
||
|
- vsprintf( msgptr, format, argp );
|
||
|
+ vsnprintf( msgbuff, sizeof(msgbuff), format, argp );
|
||
|
va_end( argp );
|
||
|
|
||
|
- ulSetError ( UL_WARNING, "%s", msgbuff ) ;
|
||
|
+ if (linenum)
|
||
|
+ {
|
||
|
+ ulSetError ( UL_WARNING, "%s, line %d: %s", path, linenum, msgbuff ) ;
|
||
|
+ } else {
|
||
|
+ ulSetError ( UL_WARNING, "%s", msgbuff ) ;
|
||
|
+ }
|
||
|
}
|
||
|
|
||
|
|
||
|
@@ -78,18 +76,16 @@ void _ssgParser::message( const char *fo
|
||
|
char msgbuff[ 255 ];
|
||
|
va_list argp;
|
||
|
|
||
|
- char* msgptr = msgbuff;
|
||
|
- if (linenum)
|
||
|
- {
|
||
|
- msgptr += sprintf ( msgptr,"%s, line %d: ",
|
||
|
- path, linenum );
|
||
|
- }
|
||
|
-
|
||
|
va_start( argp, format );
|
||
|
- vsprintf( msgptr, format, argp );
|
||
|
+ vsnprintf( msgbuff, sizeof(msgbuff), format, argp );
|
||
|
va_end( argp );
|
||
|
|
||
|
- ulSetError ( UL_DEBUG, "%s", msgbuff ) ;
|
||
|
+ if (linenum)
|
||
|
+ {
|
||
|
+ ulSetError ( UL_DEBUG, "%s, line %d: %s", path, linenum, msgbuff ) ;
|
||
|
+ } else {
|
||
|
+ ulSetError ( UL_DEBUG, "%s", msgbuff ) ;
|
||
|
+ }
|
||
|
}
|
||
|
|
||
|
// Opens the file and does a few internal calculations based on the spec.
|