Win32 compile fix (allocate buffer on heap instead of stack, probably a good
idea anyway given fc task stack sizes)
This commit is contained in:
parent
9c868b3927
commit
18ed468c6f
1 changed files with 4 additions and 3 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
#include <memory>
|
||||||
#include <fc/crypto/bigint.hpp>
|
#include <fc/crypto/bigint.hpp>
|
||||||
#include <fc/io/sstream.hpp>
|
#include <fc/io/sstream.hpp>
|
||||||
#include <fc/log/logger.hpp>
|
#include <fc/log/logger.hpp>
|
||||||
|
|
@ -10,11 +11,11 @@ namespace fc
|
||||||
|
|
||||||
const char* src = data;
|
const char* src = data;
|
||||||
int src_len = len;
|
int src_len = len;
|
||||||
char buffer[len+1];
|
std::unique_ptr<char[]> buffer(new char[len+1]);
|
||||||
if (*data & 0x80) {
|
if (*data & 0x80) {
|
||||||
buffer[0] = 0;
|
buffer[0] = 0;
|
||||||
memcpy( buffer + 1, data, len );
|
memcpy( buffer.get() + 1, data, len );
|
||||||
src = buffer;
|
src = buffer.get();
|
||||||
src_len++;
|
src_len++;
|
||||||
}
|
}
|
||||||
fc::bigint value( src, src_len );
|
fc::bigint value( src, src_len );
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue