I wanted to avoid the strlen, but we'd better keep the scanner a bit
less surprising and encourage people to use xkb_keymap_new_from_buffer()
instead of they do in fact have access to the size.
Signed-off-by: Ran Benita <ran234@gmail.com>
enum xkb_keymap_format format,
enum xkb_keymap_compile_flags flags)
{
- return xkb_keymap_new_from_buffer(ctx, string, SIZE_MAX, format, flags);
+ return xkb_keymap_new_from_buffer(ctx, string, strlen(string),
+ format, flags);
}
XKB_EXPORT struct xkb_keymap *
static inline bool
eof(struct scanner *s)
{
- return peek(s) == '\0';
+ return s->pos >= s->len;
}
static inline bool