aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2026-01-07 10:32:38 +0100
committerlemon <lsof@mailbox.org>2026-01-07 10:32:38 +0100
commitd4c632695cf3c64090de50c3d6b4b585bae77b60 (patch)
treec395ce15d21a4da69acdeddad1a4a7d9ac51c380
parentc7e34f7e4ae6854b82f345f07589a646cf8376cf (diff)
io.c: bugfix
-rw-r--r--io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/io.c b/io.c
index 9b57133..14e753a 100644
--- a/io.c
+++ b/io.c
@@ -227,7 +227,7 @@ pritypebefore(struct wbuf *buf, union type ty, int qual)
case TYSTRUCT:
s = "struct";
Tagged:
- n = bfmt(buf, "%s %s", s, (s2 = &ttypenames[typedata[ty.dat].id]->c) ? s2 : "(anonymous)");
+ n = bfmt(buf, "%s %s", s, (s2 = (char *)ttypenames[typedata[ty.dat].id]) ? s2 : "(anonymous)");
return n + priquals(buf, qual);
case TYUNION:
s = "union";
@@ -288,6 +288,7 @@ putdouble(struct wbuf *buf, double x)
{
char tmp[200];
int n = snprintf(tmp, sizeof tmp, "%f", x);
+ if (n >= sizeof tmp-1) n = snprintf(tmp, sizeof tmp, "%g", x);
assert(n < sizeof tmp-1);
iowrite(buf, tmp, n);
return n;