diff options
Diffstat (limited to 'src/binlogcat.c')
-rw-r--r-- | src/binlogcat.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/binlogcat.c b/src/binlogcat.c index bdeb992..505bbc2 100644 --- a/src/binlogcat.c +++ b/src/binlogcat.c @@ -92,8 +92,13 @@ catlog(const char *fname) fname, dataspec, header.recsize, header.recnum); inst = packcomp(dataspec, &p); - if (*p) { - error("%s: bad dataspec near %s", dataspec, p); + if (!inst) { + if (errno == EINVAL) { + error("%s: bad dataspec near %s", dataspec, p); + exit(1); + } + + error("%s", strerror(errno)); exit(1); } free(dataspec); @@ -101,7 +106,7 @@ catlog(const char *fname) rec = malloc(header.recsize); if (!rec) { error("not enough memory"); - abort(); + exit(1); } env = packenv_create(header.recsize - offsetof(struct binlog_record,data)); |