xpp: astribank_hexload: allow empty span specs

DAHDI 2.9.2 added support for -S (span specs). However if this option
was not specified, it fails to run.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
This commit is contained in:
Tzafrir Cohen 2014-07-31 17:57:32 +03:00
parent 60401c5f49
commit d4537e46ce

View File

@ -39,6 +39,7 @@
#define DBG_MASK 0x80
#define MAX_HEX_LINES 64000
#define HAVE_OCTASIC 1
#define DEF_SPAN_SPEC_FORMAT "*:%c1" /* %c: 'E' or 'T' */
static char *progname;
@ -166,6 +167,7 @@ int main(int argc, char *argv[])
#if HAVE_OCTASIC
int opt_alaw = 0;
const char *span_spec = NULL;
char def_span_spec[sizeof(DEF_SPAN_SPEC_FORMAT)];
#endif
int opt_dest = 0;
int opt_sum = 0;
@ -252,6 +254,13 @@ int main(int argc, char *argv[])
ERR("Missing device path.\n");
usage();
}
# ifdef HAVE_OCTASIC
if (!span_spec) {
snprintf(def_span_spec, sizeof(def_span_spec),
DEF_SPAN_SPEC_FORMAT, opt_alaw? 'E' : 'T');
span_spec = def_span_spec;
}
#endif
if(opt_dest) {
/*
* MPP Interface