Commit a18ea3dd authored by Rein Klazes's avatar Rein Klazes Committed by Alexandre Julliard

Don't use formatted output in WCMD_setshow_sortenv.

Don't use unsafe vsprintf in WCMD_output.
parent 65ad3f25
......@@ -792,8 +792,10 @@ static void WCMD_setshow_sortenv(const char *s)
qsort( str, count, sizeof (char*), WCMD_compare );
/* print it */
for( i=0; i<count; i++ )
WCMD_output("%s\n", str[i] );
for( i=0; i<count; i++ ) {
WCMD_output_asis(str[i]);
WCMD_output_asis("\n");
}
LocalFree( str );
}
......
......@@ -789,10 +789,15 @@ void WCMD_output (const char *format, ...) {
va_list ap;
char string[1024];
int ret;
va_start(ap,format);
vsprintf (string, format, ap);
ret = vsnprintf (string, sizeof( string), format, ap);
va_end(ap);
if( ret >= sizeof( string)) {
WCMD_output_asis("ERR: output truncated in WCMD_output\n" );
string[sizeof( string) -1] = '\0';
}
WCMD_output_asis(string);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment