From 18383b973877f4c30c878414a51c0b44ea5dafe4 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Wed, 22 Apr 2020 19:33:09 -0700 Subject: feat: added generic interfaces for I/O --- sys/libbio/io/newick.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/libbio/io/newick.c b/sys/libbio/io/newick.c index f3aeb8a..0004fac 100644 --- a/sys/libbio/io/newick.c +++ b/sys/libbio/io/newick.c @@ -336,6 +336,8 @@ bio·readnewick(Stream *file, mem·Allocator heap) error dump(bio·Node *node, Stream *out) { + byte b[24]; + if (!node) { return 1; } @@ -357,8 +359,8 @@ dump(bio·Node *node, Stream *out) if (node->parent) { io·putbyte(out, ':'); - // TODO(nnoll): Format float - io·putbyte(out, '0'); + snprintf(b, arrlen(b), "%f", node->dist); + io·putstring(out, b); } return 0; -- cgit v1.2.1