cmd: Use WCMD_output_asis*() for strings that are not supposed to contain formating directives.

Francois Gouget fgouget at free.fr
Thu Nov 24 13:00:55 CST 2011


On Thu, 24 Nov 2011, Frédéric Delanoy wrote:
[...]
> > -            WCMD_output(newline);
> > +            WCMD_output_asis(newline);
> ...
> >       static const WCHAR newLine2[] = {'\n','\n','\0'};
> > -      if (!bare) WCMD_output (newLine2);
> > +      if (!bare) WCMD_output_asis (newLine2);
> ...
> > -  WCMD_output(anykey);
> > +  WCMD_output_asis(anykey);
> 
> No need to change those, since we control those strings, and those are
> generic strings with no '%' directive.

Sure these won't cause a crash if left as is.

But as you said we do control these strings and thus we know they don't 
need to go through wsprintf() and an extra string buffer before being 
passed on to WCMD_output_asis_*().

Also changing them to WCMD_output_asis_*() means fewer WCMD_output*() 
calls to audit for potential issues (not just '%' directives but also 
buffer size issues, etc).

So I think it's still very worthwhile to change them.

-- 
Francois Gouget <fgouget at free.fr>              http://fgouget.free.fr/
           Vote Electronique: Les gens qui votent ne décident rien.
                 Ceux qui comptent les votes décident de tout.


More information about the wine-devel mailing list