dump_ptr_referrer (const char *label, void const *address)
{
char buf[128];
- buf[0] = '\0';
- sprintf (buf, "%s @ %p", label, address);
+ if (sizeof buf <= snprintf (buf, sizeof buf, "%s @ %p", label, address))
+ strcpy (buf + sizeof buf - 4, "...");
return build_string (buf);
}
case PVEC_TS_NODE:
break;
}
- char msg[60];
- snprintf (msg, sizeof msg, "pseudovector type %d", (int) ptype);
+ int iptype = ptype;
+ static char const fmt[] = "pseudovector type %d";
+ char msg[sizeof fmt - sizeof "%d" + INT_STRLEN_BOUND (iptype) + 1];
+ sprintf (msg, fmt, iptype);
error_unsupported_dump_object (ctx, lv, msg);
}