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)
|
while (fgets(input, MAX_LINE, stdin) != NULL)
|
||||||
{
|
{
|
||||||
input[strcspn(input, "\n")] = 0;
|
input[strcspn(input, "\n")] = 0;
|
||||||
len = strlen(input);
|
if ((len = strlen(input)) == 1 && toupper(input[0]) == 'Q')
|
||||||
if (len == 1 && toupper(input[0]) == 'Q')
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
parse_input(vmr, input, len);
|
parse_input(vmr, input, len);
|
||||||
|
|
||||||
memset(input, '\0', MAX_LINE); /* reset input buffer */
|
memset(input, 0, MAX_LINE); /* reset input buffer */
|
||||||
printf(">> ");
|
printf(">> ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -328,7 +327,8 @@ void parse_command(PT_VMR vmr, char *command)
|
|||||||
printf("%s: %.1f\n", command, res.val.f);
|
printf("%s: %.1f\n", command, res.val.f);
|
||||||
break;
|
break;
|
||||||
case STRING_T:
|
case STRING_T:
|
||||||
printf("%s: %ls\n", command, res.val.s);
|
if (res.val.s[0] != '\0')
|
||||||
|
printf("%s: %ls\n", command, res.val.s);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user