rules: quiet a gcc warning

src/xkbcomp/rules.c:620:36: error: 'idx' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Can't happen but no harm done.

Signed-off-by: Ran Benita <ran234@gmail.com>
master
Ran Benita 2013-03-13 13:55:11 +02:00 committed by Daniel Stone
parent 559252a1a8
commit 0e200bd507
1 changed files with 1 additions and 0 deletions

View File

@ -555,6 +555,7 @@ static int
extract_layout_index(const char *s, size_t max_len, xkb_layout_index_t *out)
{
/* This function is pretty stupid, but works for now. */
*out = XKB_LAYOUT_INVALID;
if (max_len < 3)
return -1;
if (s[0] != '[' || !isdigit(s[1]) || s[2] != ']')