diff --git a/src/FileUtils.cpp b/src/FileUtils.cpp index 03f033c..302c759 100644 --- a/src/FileUtils.cpp +++ b/src/FileUtils.cpp @@ -111,7 +111,7 @@ int FileUtils::fileMode(const char* path) throw (IOException) { throw IOException("Error reading file permissions for " + std::string(path)); } - return fileInfo.st_mode; + return *reinterpret_cast(&fileInfo.st_mode); #else // not implemented for Windows return 0; diff --git a/src/UpdateDialogGtkFactory.cpp b/src/UpdateDialogGtkFactory.cpp index c62e129..aade193 100644 --- a/src/UpdateDialogGtkFactory.cpp +++ b/src/UpdateDialogGtkFactory.cpp @@ -35,8 +35,12 @@ UpdateDialogGtk* (*update_dialog_gtk_new)() = 0; bool extractFileFromBinary(int fd, const void* buffer, size_t length) { - size_t count = write(fd,buffer,length); - return count >= length; + ssize_t count = write(fd,buffer,length); + if(count < 0) + { + return false; + } + return static_cast(count) >= length; } UpdateDialog* UpdateDialogGtkFactory::createDialog()