diff --git a/src/msapll.cpp b/src/msapll.cpp index 3773456..d084829 100644 --- a/src/msapll.cpp +++ b/src/msapll.cpp @@ -516,8 +516,9 @@ namespace modeltest /* read FASTA sequences for finding the number of tips and seq len */ /* make sure they are all of the same length */ + int ret; for (cur_seq = 0; - pll_fasta_getnext (fp, &hdr, &hdr_len, &seq, &n_sites_read, &seq_idx); ++cur_seq) + (ret = pll_fasta_getnext (fp, &hdr, &hdr_len, &seq, &n_sites_read, &seq_idx)); ++cur_seq) { if (dt_unknown) { @@ -557,6 +558,14 @@ namespace modeltest free (hdr); } + // Passthrough illegal character errors + if (ret == PLL_FAILURE && (pll_errno == PLL_ERROR_FASTA_ILLEGALCHAR || pll_errno == PLL_ERROR_FASTA_UNPRINTABLECHAR)) { + mt_errno = MT_ERROR_ALIGNMENT; + strncpy(mt_errmsg, pll_errmsg, ERR_MSG_SIZE); + free(hdr); + free(seq); + } + if (sites == MT_SIZE_UNDEF) { switch (pll_errno)