Uses std::string

MD-20923
This commit is contained in:
Carles Pina 2014-11-20 12:00:01 +00:00
parent ac93a8b06f
commit 0ef971a251

View file

@ -31,8 +31,6 @@ UpdateDialogGtk* (*update_dialog_gtk_new)() = 0;
#define BIND_FUNCTION(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)
{
size_t count = write(fd,buffer,length);
@ -42,8 +40,7 @@ bool extractFileFromBinary(int fd, const void* buffer, size_t length)
UpdateDialog* UpdateDialogGtkFactory::createDialog()
{
char* libPath = (char*)malloc(MAX_FILE_PATH);
snprintf(libPath, MAX_FILE_PATH, "/tmp/mendeley-libUpdaterGtk.so.XXXXXX");
char* libPath = strdup(std::string("/tmp/mendeley-libUpdaterGtk.so.XXXXXX").c_str());
int libFd = mkostemp(libPath, O_CREAT | O_WRONLY | O_TRUNC);
if (libFd == -1)