r1198: exit if .alt is malformatted

Resolves #232
This commit is contained in:
Heng Li 2019-01-23 13:23:25 -05:00
parent e4d7a94252
commit cd29a7cb54
2 changed files with 8 additions and 2 deletions

View File

@ -197,7 +197,13 @@ bntseq_t *bns_restore(const char *prefix)
}
while (c != '\n' && c != EOF) c = fgetc(fp);
i = 0;
} else str[i++] = c; // FIXME: potential segfault here
} else {
if (i >= 1022) {
fprintf(stderr, "[E::%s] sequence name longer than 1023 characters. Abort!\n", __func__);
exit(1);
}
str[i++] = c;
}
}
kh_destroy(str, h);
fclose(fp);

2
main.c
View File

@ -4,7 +4,7 @@
#include "utils.h"
#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION "0.7.17-r1194-dirty"
#define PACKAGE_VERSION "0.7.17-r1198-dirty"
#endif
int bwa_fa2pac(int argc, char *argv[]);