mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 08:51:10 +02:00
src/nhttpd/yhttpd_core/helper.cpp revert unneeded sie check
This commit is contained in:
@@ -81,14 +81,7 @@ std::string timeString(time_t time) {
|
|||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
std::string string_printf(const char *fmt, ...) {
|
std::string string_printf(const char *fmt, ...) {
|
||||||
va_list arglist;
|
va_list arglist;
|
||||||
va_start (arglist, fmt);
|
|
||||||
int len = vsnprintf (NULL, 0, fmt, arglist);
|
|
||||||
va_end (arglist);
|
|
||||||
const int bufferlen = 4*1024;
|
const int bufferlen = 4*1024;
|
||||||
if(len >= bufferlen){
|
|
||||||
printf("string_printf: error: buffer overflow : len %i line %i\n",len,__LINE__);
|
|
||||||
return "error";
|
|
||||||
}
|
|
||||||
char buffer[bufferlen] = {0};
|
char buffer[bufferlen] = {0};
|
||||||
va_start(arglist, fmt);
|
va_start(arglist, fmt);
|
||||||
vsnprintf(buffer, bufferlen, fmt, arglist);
|
vsnprintf(buffer, bufferlen, fmt, arglist);
|
||||||
|
Reference in New Issue
Block a user