diff options
author | marha <marha@users.sourceforge.net> | 2013-07-19 08:33:43 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-07-19 08:33:43 +0200 |
commit | 45b71fd5b777a968310c537ace5efcd1443085a0 (patch) | |
tree | a3ef2b449659c3ba6c885d169c7796b3ef948867 /xkbcomp/xkbscan.c | |
parent | 08bafbbe05abefabdb0c3238c3d9ecdcce1b692f (diff) | |
parent | 89bc3ee988b62eb5e10284bac32a176955546410 (diff) | |
download | vcxsrv-45b71fd5b777a968310c537ace5efcd1443085a0.tar.gz vcxsrv-45b71fd5b777a968310c537ace5efcd1443085a0.tar.bz2 vcxsrv-45b71fd5b777a968310c537ace5efcd1443085a0.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
mesa xkbcomp git update 19 Jul 2013
Diffstat (limited to 'xkbcomp/xkbscan.c')
-rw-r--r-- | xkbcomp/xkbscan.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/xkbcomp/xkbscan.c b/xkbcomp/xkbscan.c index 24b1e0f06..4c3fe3228 100644 --- a/xkbcomp/xkbscan.c +++ b/xkbcomp/xkbscan.c @@ -401,6 +401,7 @@ static int yyGetKeyName(void) { int ch, i; + int last; i = 0; while (((ch = scanchar()) != EOF) && (ch != '>')) @@ -466,12 +467,20 @@ yyGetKeyName(void) if (i < sizeof(scanBuf) - 1) scanBuf[i++] = ch; } + + if (i < sizeof(scanBuf) - i) + last = i; + else + last = sizeof(scanBuf) - 1; + + scanBuf[last] = '\0'; + if ((ch == '>') && (i < 5)) { - scanBuf[i++] = '\0'; scanStrLine = lineNum; return KEYNAME; } + return ERROR_TOK; } |