From 0ebdf47fd4bc434ac3d2339544c022a869510738 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 11 Jul 2013 13:53:31 +1000 Subject: Parse -w1 flag correctly (#66344) if the flag is "-w", then argv[i][1] is 'w' and unlikely to be a digit. Access [2] instead, which is either \0 or an actual digit. X.Org Bug 66344 Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith Reviewed-by: Matt Dew --- xkbcomp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xkbcomp.c b/xkbcomp.c index 440d542..fb5dec2 100644 --- a/xkbcomp.c +++ b/xkbcomp.c @@ -579,8 +579,8 @@ parseArgs(int argc, char *argv[]) if ((i >= (argc - 1)) || (!isdigit(argv[i + 1][0]))) { warningLevel = 0; - if (isdigit(argv[i][1])) - if (sscanf(&argv[i][1], "%i", &itmp) == 1) + if (isdigit(argv[i][2])) + if (sscanf(&argv[i][2], "%i", &itmp) == 1) warningLevel = itmp; } else -- cgit v1.2.3