+2021-05-07 Mike Frysinger <vapier@gentoo.org>
+
+ * dv-m68hc11tim.c (cycle_to_string): Increase buf to 128 bytes.
+ Merge two sprintf buf calls.
+
2021-05-06 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_hw_configure): Change %lx to %x in format strings.
{
char time_buf[32];
char cycle_buf[32];
- static char buf[64];
+ /* Big enough to handle 64-bit t, time_buf, and cycle_buf. */
+ static char buf[128];
time_buf[0] = 0;
cycle_buf[0] = 0;
sprintf (cycle_buf, " cycle%s",
(t > 1 ? "s" : ""));
- if (t < LONG_MAX)
- sprintf (buf, "%9lu%s%s", (unsigned long) t, cycle_buf, time_buf);
- else
- sprintf (buf, "%" PRIi64 "%s%s", t, cycle_buf, time_buf);
+ sprintf (buf, "%9" PRIi64 "%s%s", t, cycle_buf, time_buf);
return buf;
}