fix: segv in sample command

This commit is contained in:
TT 2020-03-08 19:37:26 +09:00
parent 7c2e4364e6
commit 6befd57bc1

2
main.c
View file

@ -699,7 +699,7 @@ VNA_SHELL_FUNCTION(cmd_sample)
if (argc!=1) goto usage; if (argc!=1) goto usage;
// 0 1 2 // 0 1 2
static const char cmd_sample_list[] = "gamma|ampl|ref"; static const char cmd_sample_list[] = "gamma|ampl|ref";
switch (getStringIndex(argv[1], cmd_sample_list)){ switch (getStringIndex(argv[0], cmd_sample_list)){
case 0:sample_func = calculate_gamma; return; case 0:sample_func = calculate_gamma; return;
case 1:sample_func = fetch_amplitude; return; case 1:sample_func = fetch_amplitude; return;
case 2:sample_func = fetch_amplitude_ref; return; case 2:sample_func = fetch_amplitude_ref; return;