summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/htslib.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/htslib.c b/src/htslib.c
index 9a48b62..313b2ba 100644
--- a/src/htslib.c
+++ b/src/htslib.c
@@ -5650,6 +5650,17 @@ HTSEXT_API void hts_free_opt(httrackp * opt) {
// TEMPORARY - PUT THIS STRUCTURE INSIDE httrackp !
const hts_stat_struct* hts_get_stats(httrackp * opt) {
+ if (opt == NULL) {
+ return NULL;
+ }
+
+ HTS_STAT.stat_nsocket = 0;
+ HTS_STAT.stat_errors = fspc(opt, NULL, "error");
+ HTS_STAT.stat_warnings = fspc(opt, NULL, "warning");
+ HTS_STAT.stat_infos = fspc(opt, NULL, "info");
+ HTS_STAT.nbk = 0;
+ HTS_STAT.nb = 0;
+
return &HTS_STAT;
}