aboutsummaryrefslogtreecommitdiff
path: root/src/c/quikr_functions.c
diff options
context:
space:
mode:
authorCalvin Morrison <mutantturkey@gmail.com>2014-04-29 09:54:04 -0400
committerCalvin Morrison <mutantturkey@gmail.com>2014-04-29 09:54:04 -0400
commit2ab448ea29d08a42caa4911c59ad7a8566b919c6 (patch)
treed2b534b16d74ac7e3aaaad6bbc736ef8b51c6c49 /src/c/quikr_functions.c
parent65709a225fe0816be6d345e1401a8d67f3a0c9d1 (diff)
add line errors i think
Diffstat (limited to 'src/c/quikr_functions.c')
-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);
}