[PATCH xkbcomp 1/2] Removing unnecessary and unsafe code in scanchar()
Dirk Wallenstein
halsmit at t-online.de
Sun Jan 16 01:16:33 PST 2011
On Sun, Jan 16, 2011 at 01:26:09AM +0500, Alexandr Shadchin wrote:
> If readBufLen == BUFSIZE and feof() != 0, then go outside the boundaries
> of buffer.
>
> Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
> ---
> xkbscan.c | 2 --
> 1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/xkbscan.c b/xkbscan.c
> index 03193e2..6d3678e 100644
> --- a/xkbscan.c
> +++ b/xkbscan.c
> @@ -277,8 +277,6 @@ scanchar(void)
> readBufPos = 0;
> if (!readBufLen)
> return EOF;
> - if (feof(yyin))
> - readBuf[readBufLen] = EOF;
> }
>
> return readBuf[readBufPos++];
> --
> 1.7.3.5
>
And that position was never read. It would be nice to have the reason
why it can be removed without replacement in the commit message.
Reviewed-by: Dirk Wallenstein <halsmit at t-online.de>
--
Greetings,
Dirk
More information about the xorg-devel
mailing list