Mesa (master): glsl_compiler: Remove unused extra argument to printf in usage_fail

Alan Coopersmith alanc at kemper.freedesktop.org
Fri Jun 5 02:02:00 UTC 2015


Module: Mesa
Branch: master
Commit: cb277cde6f2a210b0515cd04269964fd409307e9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cb277cde6f2a210b0515cd04269964fd409307e9

Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat May 23 00:03:53 2015 -0700

glsl_compiler: Remove unused extra argument to printf in usage_fail

Flagged by Oracle's parfait static analyzer:

Error: Format string argument mismatch (CWE 628)
   In call to printf with format string "usage: %s [options] <file.vert | file.geom | file.frag>\n\nPossible options are:\n"
      Too many arguments for format string (got more than 1 arguments)
        at line 285 of src/glsl/main.cpp in function 'usage_fail'.

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
Reviewed-by: Matt Turner <mattst88 at gmail.com>

---

 src/glsl/main.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
index ccac839..4b39c9e 100644
--- a/src/glsl/main.cpp
+++ b/src/glsl/main.cpp
@@ -282,7 +282,7 @@ usage_fail(const char *name)
       "usage: %s [options] <file.vert | file.geom | file.frag>\n"
       "\n"
       "Possible options are:\n";
-   printf(header, name, name);
+   printf(header, name);
    for (const struct option *o = compiler_opts; o->name != 0; ++o) {
       printf("    --%s\n", o->name);
    }




More information about the mesa-commit mailing list