mirror of https://github.com/kiwix/libkiwix.git
Merge pull request #635 from kiwix/fix_httplib
This commit is contained in:
commit
251f3a01ed
|
@ -2889,12 +2889,12 @@ inline ssize_t Stream::write(const std::string &s) {
|
||||||
|
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
inline ssize_t Stream::write_format(const char *fmt, const Args &... args) {
|
inline ssize_t Stream::write_format(const char *fmt, const Args &... args) {
|
||||||
std::array<char, 2048> buf;
|
std::array<char, 2048> buf{};
|
||||||
|
|
||||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||||
auto sn = _snprintf_s(buf, bufsiz, 2048 - 1, fmt, args...);
|
auto sn = _snprintf_s(buf, bufsiz, buf.size() - 1, fmt, args...);
|
||||||
#else
|
#else
|
||||||
auto sn = snprintf(buf.data(), 2048 - 1, fmt, args...);
|
auto sn = snprintf(buf.data(), buf.size() - 1, fmt, args...);
|
||||||
#endif
|
#endif
|
||||||
if (sn <= 0) { return sn; }
|
if (sn <= 0) { return sn; }
|
||||||
|
|
||||||
|
@ -3756,9 +3756,9 @@ inline socket_t Client::create_client_socket() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool Client::read_response_line(Stream &strm, Response &res) {
|
inline bool Client::read_response_line(Stream &strm, Response &res) {
|
||||||
std::array<char, 2048> buf;
|
std::array<char, 2048> buf{};
|
||||||
|
|
||||||
detail::stream_line_reader line_reader(strm, buf.data(), 2048);
|
detail::stream_line_reader line_reader(strm, buf.data(), buf.size());
|
||||||
|
|
||||||
if (!line_reader.getline()) { return false; }
|
if (!line_reader.getline()) { return false; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue