comparison utils/themwi-update-outrt.c @ 132:aa278d75d757

themwi-update-outrt: catch and reject empty tables
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 06 Oct 2022 22:49:26 -0800
parents 5c7109183c8c
children de7c64c4d6fd
comparison
equal deleted inserted replaced
131:5c7109183c8c 132:aa278d75d757
461 exit(1); 461 exit(1);
462 } 462 }
463 for (lineno = 1; fgets(linebuf, sizeof linebuf, inf); lineno++) 463 for (lineno = 1; fgets(linebuf, sizeof linebuf, inf); lineno++)
464 process_line(); 464 process_line();
465 fclose(inf); 465 fclose(inf);
466 if (!dest_rec_count) {
467 fprintf(stderr, "error: no SIP destinations defined\n");
468 exit(1);
469 }
470 if (!inn_rec_count && !special_num_count) {
471 fprintf(stderr, "error: no routes defined\n");
472 exit(1);
473 }
466 emit_output(); 474 emit_output();
467 /* make it live */ 475 /* make it live */
468 if (rename("out-routes.newbin", "out-routes.bin") < 0) { 476 if (rename("out-routes.newbin", "out-routes.bin") < 0) {
469 perror("rename"); 477 perror("rename");
470 exit(1); 478 exit(1);