Skip to content

Commit d2c7b44

Browse files
committed
Fix yhirose#289: Fixed build problem with Visual C++
1 parent 72b20c0 commit d2c7b44

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

httplib.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2285,11 +2285,11 @@ inline std::string message_digest(const std::string &s, Init init,
22852285
size_t digest_length) {
22862286
using namespace std;
22872287

2288-
unsigned char md[digest_length];
2288+
std::vector<unsigned char> md(digest_length, 0);
22892289
CTX ctx;
22902290
init(&ctx);
22912291
update(&ctx, s.data(), s.size());
2292-
final(md, &ctx);
2292+
final(md.data(), &ctx);
22932293

22942294
stringstream ss;
22952295
for (auto c : md) {

0 commit comments

Comments
 (0)