# HG changeset patch # User Mychaela Falconia # Date 1665125366 28800 # Node ID aa278d75d757343e33bd7453016f39b14fa536a2 # Parent 5c7109183c8c0da159dfa1113c2b818fb1dcfd9f themwi-update-outrt: catch and reject empty tables diff -r 5c7109183c8c -r aa278d75d757 utils/themwi-update-outrt.c --- a/utils/themwi-update-outrt.c Thu Oct 06 21:19:59 2022 -0800 +++ b/utils/themwi-update-outrt.c Thu Oct 06 22:49:26 2022 -0800 @@ -463,6 +463,14 @@ for (lineno = 1; fgets(linebuf, sizeof linebuf, inf); lineno++) process_line(); fclose(inf); + if (!dest_rec_count) { + fprintf(stderr, "error: no SIP destinations defined\n"); + exit(1); + } + if (!inn_rec_count && !special_num_count) { + fprintf(stderr, "error: no routes defined\n"); + exit(1); + } emit_output(); /* make it live */ if (rename("out-routes.newbin", "out-routes.bin") < 0) {