diff options
author | jkh <jkh@FreeBSD.org> | 2000-03-08 14:20:26 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 2000-03-08 14:20:26 +0000 |
commit | 8f2020240d267e320d0544bbf4b5527725d811a5 (patch) | |
tree | d3dcb873429a8960f0d3fb6c6a0d83e171d21a51 /usr.sbin/sysinstall | |
parent | 1a6acdd95fbe8b2547544db42a78d77f65da9924 (diff) | |
download | FreeBSD-src-8f2020240d267e320d0544bbf4b5527725d811a5.zip FreeBSD-src-8f2020240d267e320d0544bbf4b5527725d811a5.tar.gz |
Whoops - really make the "fix" I did to the dmenuToggleVariable logic
work.
Diffstat (limited to 'usr.sbin/sysinstall')
-rw-r--r-- | usr.sbin/sysinstall/dmenu.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.sbin/sysinstall/dmenu.c b/usr.sbin/sysinstall/dmenu.c index 79762be..7f113fc 100644 --- a/usr.sbin/sysinstall/dmenu.c +++ b/usr.sbin/sysinstall/dmenu.c @@ -132,15 +132,21 @@ dmenuSetKmapVariable(dialogMenuItem *tmp) int dmenuToggleVariable(dialogMenuItem *tmp) { - char *var; + char *var, *cp; int status; - if (!(var = (char *)tmp->data)) { + if (!(var = strdup((char *)tmp->data))) { msgConfirm("Incorrect data field for `%s'!", tmp->title); return DITEM_FAILURE; } + if (!(cp = index(var, '='))) { + msgConfirm("Data field for %s is not in var=value format!", tmp->title); + return DITEM_FAILURE; + } status = variable_check(var); + *cp = '\0'; variable_set2(var, status ? "NO" : "YES", *var != '_'); + free(var); return DITEM_SUCCESS; } |