}
void
-ID::print (char* buf) const
+ID::print (char* buf, uint32_t bufsize) const
{
- /* XXX sizeof buf is unknown. bad API design */
- snprintf (buf, 32, "%" PRIu64, _id);
+ snprintf (buf, bufsize, "%" PRIu64, _id);
}
string ID::to_s() const
{
char buf[32]; // see print()
- print(buf);
+ print(buf, sizeof (buf));
return string(buf);
}
operator<< (ostream& ostr, const ID& _id)
{
char buf[32];
- _id.print (buf);
+ _id.print (buf, sizeof (buf));
ostr << buf;
return ostr;
}