diff options
Diffstat (limited to 'src/libbio/newick.c')
-rw-r--r-- | src/libbio/newick.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libbio/newick.c b/src/libbio/newick.c index a855cea..a555379 100644 --- a/src/libbio/newick.c +++ b/src/libbio/newick.c @@ -50,8 +50,8 @@ tokstr(struct Token tok) case tok·comma: return ","; case tok·semi: return ";"; case tok·colon: return ":"; - case tok·number: - snprintf(b, arrlen(b), "%f", tok.lit.x); + case tok·number: + fmt·nsprint(b, arrlen(b), "%f", tok.lit.x); return b; default: return nil; @@ -80,8 +80,8 @@ lex(io·Peeker s, void* fp) c = b; *c = s.get(fp); - if (isspace(*c)) { - while (isspace(*c)) { + if(utf8·isspace(*c)){ + while(utf8·isspace(*c)){ *(++c) = s.get(fp); } @@ -107,7 +107,7 @@ lex(io·Peeker s, void* fp) case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': - while (isdigit(*c)) { + while(utf8·isdigit(*c)){ NUM: *(++c) = s.get(fp); } if (*c == '.') goto NUM; @@ -194,7 +194,7 @@ parse(struct Parser *p) } node = p->mem.alloc(p->heap, 1, sizeof(*node)); - memset(node, 0, sizeof(*node)); + mem·set(node, sizeof(*node), 0); if (p->root) { phylo·addchild(p->root, node); @@ -281,7 +281,7 @@ parse(struct Parser *p) } node = p->mem.alloc(p->heap, 1, sizeof(*node)); - memset(node, 0, sizeof(*node)); + mem·set(node, sizeof(*node), 0); node->name = string·make(tok.lit.s); @@ -396,7 +396,7 @@ dump(bio·Node *node, void *impl, io·Putter out) if (node->parent) { out.put(impl, ':'); - snprintf(b, arrlen(b), "%f", node->dist); + fmt·nsprint(b, arrlen(b), "%f", node->dist); out.puts(impl, b); } |