aboutsummaryrefslogtreecommitdiff
path: root/sys/libbio
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2020-04-22 18:25:09 -0700
committerNicholas Noll <nbnoll@eml.cc>2020-04-22 18:25:09 -0700
commit9fb0a22dcb1ae04a1007316497fe6d11b91d8183 (patch)
tree4f78507d5131a6c798e62da64997b6db2782ed4a /sys/libbio
parentfb4c4ceba416376751196cdbbdb5f7240e08a405 (diff)
fix: moved byte buffer to static storage so you don't read off stale stack
Diffstat (limited to 'sys/libbio')
-rw-r--r--sys/libbio/io/newick.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/libbio/io/newick.c b/sys/libbio/io/newick.c
index 5bd2d9a..f3aeb8a 100644
--- a/sys/libbio/io/newick.c
+++ b/sys/libbio/io/newick.c
@@ -67,8 +67,9 @@ static
struct Token
lex(Stream *s)
{
+ byte *c;
struct Token tok;
- byte *c, b[1024];
+ static byte b[1024];
c = b;
*c = io·getbyte(s);
@@ -120,7 +121,7 @@ lex(Stream *s)
io·ungetbyte(s, *c);
Assert(c - b < 1024);
- *c = 0;
+ *c = '\0';
tok.kind = tok·ident;
tok.lit.s = b;
return tok;