mirror of
https://github.com/etlegacy/Update-Installer.git
synced 2025-02-27 13:20:44 +00:00
Uses std::string
MD-20923
This commit is contained in:
parent
ac93a8b06f
commit
0ef971a251
1 changed files with 1 additions and 4 deletions
|
@ -31,8 +31,6 @@ UpdateDialogGtk* (*update_dialog_gtk_new)() = 0;
|
||||||
#define BIND_FUNCTION(library,function) \
|
#define BIND_FUNCTION(library,function) \
|
||||||
function = reinterpret_cast<TYPEOF(function)>(dlsym(library,#function));
|
function = reinterpret_cast<TYPEOF(function)>(dlsym(library,#function));
|
||||||
|
|
||||||
#define MAX_FILE_PATH 4096
|
|
||||||
|
|
||||||
bool extractFileFromBinary(int fd, const void* buffer, size_t length)
|
bool extractFileFromBinary(int fd, const void* buffer, size_t length)
|
||||||
{
|
{
|
||||||
size_t count = write(fd,buffer,length);
|
size_t count = write(fd,buffer,length);
|
||||||
|
@ -42,8 +40,7 @@ bool extractFileFromBinary(int fd, const void* buffer, size_t length)
|
||||||
|
|
||||||
UpdateDialog* UpdateDialogGtkFactory::createDialog()
|
UpdateDialog* UpdateDialogGtkFactory::createDialog()
|
||||||
{
|
{
|
||||||
char* libPath = (char*)malloc(MAX_FILE_PATH);
|
char* libPath = strdup(std::string("/tmp/mendeley-libUpdaterGtk.so.XXXXXX").c_str());
|
||||||
snprintf(libPath, MAX_FILE_PATH, "/tmp/mendeley-libUpdaterGtk.so.XXXXXX");
|
|
||||||
|
|
||||||
int libFd = mkostemp(libPath, O_CREAT | O_WRONLY | O_TRUNC);
|
int libFd = mkostemp(libPath, O_CREAT | O_WRONLY | O_TRUNC);
|
||||||
if (libFd == -1)
|
if (libFd == -1)
|
||||||
|
|
Loading…
Reference in a new issue