r892: avoid de:f:0.0000

This commit is contained in:
Heng Li 2018-11-24 21:54:28 -05:00
parent 128476efc9
commit 2c52364527
2 changed files with 5 additions and 2 deletions

View File

@ -287,7 +287,10 @@ static inline void write_tags(kstring_t *s, const mm_reg1_t *r)
if (r->parent == r->id) mm_sprintf_lite(s, "\ts2:i:%d", r->subsc);
if (r->p) {
char buf[16];
snprintf(buf, 16, "%.4f", 1.0 - mm_event_identity(r));
double div;
div = 1.0 - mm_event_identity(r);
if (div == 0.0) buf[0] = '0', buf[1] = 0;
else snprintf(buf, 16, "%.4f", 1.0 - mm_event_identity(r));
mm_sprintf_lite(s, "\tde:f:%s", buf);
} else if (r->div >= 0.0f && r->div <= 1.0f) {
char buf[16];

2
main.c
View File

@ -6,7 +6,7 @@
#include "mmpriv.h"
#include "ketopt.h"
#define MM_VERSION "2.14-r891-dirty"
#define MM_VERSION "2.14-r892-dirty"
#ifdef __linux__
#include <sys/resource.h>