mirror of
https://github.com/onyx-and-iris/vmrcli.git
synced 2025-01-18 08:41:08 +00:00
don't attempt to print a string result if parameter unknown
This commit is contained in:
parent
61d81b0abf
commit
9ee3f42334
@ -243,13 +243,12 @@ void interactive(PT_VMR vmr)
|
||||
while (fgets(input, MAX_LINE, stdin) != NULL)
|
||||
{
|
||||
input[strcspn(input, "\n")] = 0;
|
||||
len = strlen(input);
|
||||
if (len == 1 && toupper(input[0]) == 'Q')
|
||||
if ((len = strlen(input)) == 1 && toupper(input[0]) == 'Q')
|
||||
break;
|
||||
|
||||
parse_input(vmr, input, len);
|
||||
|
||||
memset(input, '\0', MAX_LINE); /* reset input buffer */
|
||||
memset(input, 0, MAX_LINE); /* reset input buffer */
|
||||
printf(">> ");
|
||||
}
|
||||
}
|
||||
@ -328,6 +327,7 @@ void parse_command(PT_VMR vmr, char *command)
|
||||
printf("%s: %.1f\n", command, res.val.f);
|
||||
break;
|
||||
case STRING_T:
|
||||
if (res.val.s[0] != '\0')
|
||||
printf("%s: %ls\n", command, res.val.s);
|
||||
break;
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user