summaryrefslogtreecommitdiff
path: root/xkbscan.c
diff options
context:
space:
mode:
Diffstat (limited to 'xkbscan.c')
-rw-r--r--xkbscan.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xkbscan.c b/xkbscan.c
index 814a123..22a034f 100644
--- a/xkbscan.c
+++ b/xkbscan.c
@@ -615,16 +615,16 @@ yyGetNumber(int ch)
nInBuf = 1;
while (((ch = scanchar()) != EOF)
&& (isxdigit(ch) || ((nInBuf == 1) && (ch == 'x')))
- && nInBuf < nMaxBuffSize)
+ && nInBuf < (nMaxBuffSize - 1))
{
buf[nInBuf++] = ch;
}
- if (ch == '.')
+ if ((ch == '.') && (nInBuf < (nMaxBuffSize - 1)))
{
isFloat = 1;
buf[nInBuf++] = ch;
while (((ch = scanchar()) != EOF) && (isxdigit(ch))
- && nInBuf < nMaxBuffSize)
+ && nInBuf < (nMaxBuffSize - 1))
{
buf[nInBuf++] = ch;
}