diff options
Diffstat (limited to 'xkbscan.c')
-rw-r--r-- | xkbscan.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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; } |