mirror of
https://github.com/xmrig/xmrig.git
synced 2024-11-18 10:01:06 +00:00
Removed strdup from FileLog.
This commit is contained in:
parent
b8762ed428
commit
f1827e925e
1 changed files with 10 additions and 10 deletions
|
@ -24,13 +24,14 @@
|
|||
*/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include <uv.h>
|
||||
|
||||
|
||||
#include "base/io/log/backends/FileLog.h"
|
||||
|
||||
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
#include <uv.h>
|
||||
|
||||
|
||||
xmrig::FileLog::FileLog(const char *fileName)
|
||||
{
|
||||
uv_fs_t req;
|
||||
|
@ -45,13 +46,12 @@ void xmrig::FileLog::print(int, const char *line, size_t, size_t size, bool colo
|
|||
return;
|
||||
}
|
||||
|
||||
# ifdef _WIN32
|
||||
uv_buf_t buf = uv_buf_init(strdup(line), static_cast<unsigned int>(size));
|
||||
# else
|
||||
uv_buf_t buf = uv_buf_init(strdup(line), size);
|
||||
# endif
|
||||
assert(strlen(line) == size);
|
||||
|
||||
uv_fs_t *req = new uv_fs_t;
|
||||
uv_buf_t buf = uv_buf_init(new char[size], size);
|
||||
memcpy(buf.base, line, size);
|
||||
|
||||
auto req = new uv_fs_t;
|
||||
req->data = buf.base;
|
||||
|
||||
uv_fs_write(uv_default_loop(), req, m_file, &buf, 1, -1, FileLog::onWrite);
|
||||
|
|
Loading…
Reference in a new issue