diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-07-13 16:42:19 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-07-13 16:42:19 -0700 |
commit | 397cfd30aed296e1f3f7c37e0c65ecf558ca8baa (patch) | |
tree | 4cf8f6f05c2e88e67dfb369d3cc29458f72f338c | |
parent | e7a65459a2f6ce9ea5fd3d0ac413043986c19471 (diff) |
Include both option name & argument in invalid argument errors
Found by gcc 14.1:
x11perf.c: In function ‘invalid_arg’:
x11perf.c:339:21: warning: too many arguments for format [-Wformat-extra-args]
339 | fprintf(stderr, "Error: invalid argument to %s\n", arg, option);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes: e7a6545 ("When users give invalid arguments, tell them what they did wrong")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/test/x11perf/-/merge_requests/11>
-rw-r--r-- | x11perf.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -336,7 +336,7 @@ missing_arg(const char *option) _X_NORETURN _X_COLD static void invalid_arg( const char *arg, const char *option) { - fprintf(stderr, "Error: invalid argument to %s\n", arg, option); + fprintf(stderr, "Error: invalid argument '%s' to %s\n", arg, option); usage(USAGE_OPTIONS, EXIT_FAILURE); } |