aboutsummaryrefslogtreecommitdiffstats
path: root/com32/menu
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2011-04-11 15:22:17 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2011-04-11 15:22:17 -0700
commit67603c535d96bcd611d06b2844fcd3d33da90f22 (patch)
treeba448dca590f05ca129a11b800764f982f3a44c4 /com32/menu
parenta8e74b2834664543166744cf0832e1d6db36347f (diff)
downloadsyslinux-67603c535d96bcd611d06b2844fcd3d33da90f22.tar.gz
syslinux-67603c535d96bcd611d06b2844fcd3d33da90f22.tar.xz
syslinux-67603c535d96bcd611d06b2844fcd3d33da90f22.zip
menu hiddenkey: fix parsing the config file option
Fix parsing bugs in the config file. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'com32/menu')
-rw-r--r--com32/menu/readconfig.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/com32/menu/readconfig.c b/com32/menu/readconfig.c
index 1d02120c..fdf2e27a 100644
--- a/com32/menu/readconfig.c
+++ b/com32/menu/readconfig.c
@@ -151,7 +151,7 @@ static char *get_word(char *str, const char **word)
while (*p && !my_isspace(*p))
p++;
- *word = q = refstr_alloc(p - str + 1);
+ *word = q = refstr_alloc(p - str);
memcpy(q, str, p - str);
/* refstr_alloc() already inserted a terminating NUL */
@@ -723,8 +723,7 @@ static void parse_config_file(FILE * f)
} else if (looking_at(p, "hiddenkey")) {
const char *key_name;
int key;
- p = skipspace(p + 7);
- p = get_word(p, &key_name);
+ p = get_word(skipspace(p + 9), &key_name);
p = skipspace(p);
key = key_name_to_code(key_name);
refstr_put(key_name);