Skip to content

Commit

Permalink
Fix strprintf
Browse files Browse the repository at this point in the history
  • Loading branch information
netheril96 committed Dec 29, 2016
1 parent 9d67e6d commit d5031f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/staticjson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ static std::string stringprintf(const char* format, ...)
if (sz <= 0)
return std::string();

std::string result(sz - 1, 0);
std::string result(sz, 0);
va_start(ap, format);
vsnprintf(&result[0], static_cast<size_t>(sz), format, ap);
vsnprintf(&result[0], static_cast<size_t>(sz + 1), format, ap);
va_end(ap);
return result;
}
Expand Down

0 comments on commit d5031f4

Please sign in to comment.