comparison mtctest/setup.c @ 245:5141e21596bb

themwi-test-mtc: fix ancient bug in From number setting
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 14 Aug 2023 22:23:27 -0800
parents 08d7794cdd0a
children 74dae755f85a
comparison
equal deleted inserted replaced
244:db366c3b35f7 245:5141e21596bb
156 arg++; 156 arg++;
157 if (!*arg) 157 if (!*arg)
158 return; 158 return;
159 if (!strncmp(arg, "ton=", 4)) { 159 if (!strncmp(arg, "ton=", 4)) {
160 arg += 4; 160 arg += 4;
161 if (arg[0] >= '0' && arg[1] <= '7' && !isdigit(arg[1])){ 161 if (arg[0] >= '0' && arg[0] <= '7' && !isdigit(arg[1])){
162 setup_msg.calling.type = *arg - '0'; 162 setup_msg.calling.type = *arg - '0';
163 arg++; 163 arg++;
164 } else { 164 } else {
165 fprintf(stderr, 165 fprintf(stderr,
166 "error: calling number argument contains invalid ton= part\n"); 166 "error: calling number argument contains invalid ton= part\n");
167 exit(1); 167 exit(1);
168 } 168 }
169 } else if (!strncmp(arg, "npi=", 4)) { 169 } else if (!strncmp(arg, "npi=", 4)) {
170 arg += 4; 170 arg += 4;
171 if (arg[0] >= '0' && arg[1] <= '9' && !isdigit(arg[1])){ 171 if (arg[0] >= '0' && arg[0] <= '9' && !isdigit(arg[1])){
172 setup_msg.calling.plan = *arg - '0'; 172 setup_msg.calling.plan = *arg - '0';
173 arg++; 173 arg++;
174 } else if (arg[0] == '1' && arg[1] >= '0' && 174 } else if (arg[0] == '1' && arg[1] >= '0' &&
175 arg[1] <= '5' && !isdigit(arg[2])) { 175 arg[1] <= '5' && !isdigit(arg[2])) {
176 setup_msg.calling.plan = atoi(arg); 176 setup_msg.calling.plan = atoi(arg);