From ac940a3cb44dcd4aa8e1503411ab04c97fcbcc5f Mon Sep 17 00:00:00 2001 From: Peter Kerpedjiev Date: Tue, 22 Apr 2014 13:05:01 +0200 Subject: [PATCH] Read in PSSM matrices without crashing --- kseq.h | 2 +- pssm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kseq.h b/kseq.h index 1905aa6..4d09b43 100644 --- a/kseq.h +++ b/kseq.h @@ -193,7 +193,7 @@ typedef struct __kstring_t { seq->seq.m = 256; \ seq->seq.s = (char*)malloc(seq->seq.m); \ } \ - while ((c = ks_getc(ks)) != -1 && c != '>' && c != '+' && c != '@') { \ + while ((c = ks_getc(ks)) != -1 && c != '>' && c != '+' && c != '@' && c != '&') { \ if (c == '\n') continue; /* skip empty lines */ \ seq->seq.s[seq->seq.l++] = c; /* this is safe: we always have enough space for 1 char */ \ ks_getuntil2(ks, KS_SEP_LINE, &seq->seq, 0, 1); /* read the rest of the line */ \ diff --git a/pssm.c b/pssm.c index c3618a4..8d78a22 100644 --- a/pssm.c +++ b/pssm.c @@ -42,7 +42,7 @@ PSSM init_matrix(int order, int length, int alphabet_size){ // Check if longer than max-length of PSSMs if(length >= MAXPSSMSIZE) { - fprintf(stderr,"Matrix is to long."); + fprintf(stderr,"Matrix is too long: %d", length); return NULL; }