diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2013-07-11 13:53:31 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2013-07-18 15:38:52 +1000 |
commit | 0ebdf47fd4bc434ac3d2339544c022a869510738 (patch) | |
tree | abec1d4f9e82780a59ae99e22a219aa6fe04a9bd /xkbcomp.c | |
parent | cdcd552041fc1325a2a81e3374fadb0dd15950dc (diff) |
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 <http://bugs.freedesktop.org/show_bug.cgi?id=66344>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Dew <marcoz@osource.org>
Diffstat (limited to 'xkbcomp.c')
-rw-r--r-- | xkbcomp.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |