diff options
| author | 2026-01-07 10:32:38 +0100 | |
|---|---|---|
| committer | 2026-01-07 10:32:38 +0100 | |
| commit | d4c632695cf3c64090de50c3d6b4b585bae77b60 (patch) | |
| tree | c395ce15d21a4da69acdeddad1a4a7d9ac51c380 /io.c | |
| parent | c7e34f7e4ae6854b82f345f07589a646cf8376cf (diff) | |
io.c: bugfix
Diffstat (limited to 'io.c')
| -rw-r--r-- | io.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |