Cleanup, dead code removal, some pretty insignificant security stuff that's based on recommendations.

This commit is contained in:
Adam Ierymenko 2014-04-18 00:14:12 -07:00
parent 5f45977e3e
commit 7831c4bfef
6 changed files with 31 additions and 33 deletions

View file

@ -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)
{