Cleanup, dead code removal, some pretty insignificant security stuff that's based on recommendations.
This commit is contained in:
parent
5f45977e3e
commit
7831c4bfef
6 changed files with 31 additions and 33 deletions
|
@ -395,22 +395,6 @@ std::string Utils::trim(const std::string &s)
|
|||
return s.substr(start,end - start);
|
||||
}
|
||||
|
||||
void Utils::stdsprintf(std::string &s,const char *fmt,...)
|
||||
throw(std::bad_alloc,std::length_error)
|
||||
{
|
||||
char buf[65536];
|
||||
va_list ap;
|
||||
|
||||
va_start(ap,fmt);
|
||||
int n = vsnprintf(buf,sizeof(buf),fmt,ap);
|
||||
va_end(ap);
|
||||
|
||||
if ((n >= (int)sizeof(buf))||(n < 0))
|
||||
throw std::length_error("printf result too large");
|
||||
|
||||
s.append(buf);
|
||||
}
|
||||
|
||||
unsigned int Utils::snprintf(char *buf,unsigned int len,const char *fmt,...)
|
||||
throw(std::length_error)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue