Bonus: more rigorous error checking. Crap like '-echar 666' and '-echar 0x' are now rejected.
FIXME the error messages are crap: qemu-system-x86_64: -echr 666: Parameter 'null' expects int8_t qemu-system-x86_64: -echr 0x: Parameter '<anonymous>' expects integer Signed-off-by: Markus Armbruster <[email protected]> --- qapi/options.json | 2 +- vl.c | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/qapi/options.json b/qapi/options.json index 5a8fdc04ad..853908560d 100644 --- a/qapi/options.json +++ b/qapi/options.json @@ -3892,7 +3892,7 @@ # !end texinfo ## { 'option': '--echr', - 'data': 'str', # FIXME int + 'data': 'int8', 'help': "-echr chr set terminal escape character instead of ctrl-a" } ## diff --git a/vl.c b/vl.c index b9524f7e11..4af2905c60 100644 --- a/vl.c +++ b/vl.c @@ -3574,14 +3574,8 @@ int main(int argc, char **argv, char **envp) } break; case QAPI_OPTION_KIND_ECHR: - { - char *r; - term_escape_char = strtol(qopt[i].u.echr.data, &r, 0); - if (r == qopt[i].u.echr.data) { - printf("Bad argument to echr\n"); - } - break; - } + term_escape_char = qopt[i].u.echr.data; + break; case QAPI_OPTION_KIND_MONITOR: default_monitor = 0; if (strncmp(qopt[i].u.monitor.data, "none", 4)) { -- 2.13.6
