aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCalvin Morrison <mutantturkey@gmail.com>2014-05-04 17:14:12 -0400
committerCalvin Morrison <mutantturkey@gmail.com>2014-05-04 17:14:12 -0400
commit151602f582746f8374a3f8bc4ea1ffdbcc4a513a (patch)
tree18762de999bb35ebf9b511e91e6a17c55fd49a71
parent6cff7280e6ee8acc23659374cf8b34a8e0d4cef7 (diff)
parent2ab448ea29d08a42caa4911c59ad7a8566b919c6 (diff)
Merge branch 'master' of github.com:mutantturkey/quikr
-rw-r--r--src/c/quikr_functions.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/c/quikr_functions.c b/src/c/quikr_functions.c
index 5bbe913..f690549 100644
--- a/src/c/quikr_functions.c
+++ b/src/c/quikr_functions.c
@@ -198,14 +198,16 @@ struct matrix *load_sensing_matrix(const char *filename, unsigned int target_kme
headers = malloc(sequences * sizeof(char *));
check_malloc(headers, NULL);
+ unsigned long long lineno = 0;
for(i = 0; i < sequences; i++) {
unsigned long long j = 0;
// get header and add it to headers array
- char *header = malloc(256 * sizeof(char));
+ char *header = malloc(512 * sizeof(char));
check_malloc(header, NULL);
- gzgets(fh, header, 256);
+ gzgets(fh, header, 512);
+ lineno++;
if(header[0] != '>') {
- fprintf(stderr, "Error parsing sensing matrix, could not read header\n");
+ fprintf(stderr, "Error parsing sensing matrix, could not read header in line %llu\n", lineno);
exit(EXIT_FAILURE);
}
@@ -216,8 +218,9 @@ struct matrix *load_sensing_matrix(const char *filename, unsigned int target_kme
for(j = 0; j < width; j++) {
line = gzgets(fh, line, 32);
+ lineno++;
if(line == NULL || line[0] == '>') {
- fprintf(stderr, "Error parsing sensing matrix, line does not look like a value\n");
+ fprintf(stderr, "Error parsing sensing matrix, line does not look like a value in line %llu\n", lineno);
exit(EXIT_FAILURE);
}