diff --git a/src/bled/bled.c b/src/bled/bled.c index 98273a50..480b5d86 100644 --- a/src/bled/bled.c +++ b/src/bled/bled.c @@ -1,5 +1,5 @@ /* - * Bled (Busybox Library for Easy Decompression) + * Bled (Base Library for Easy Decompression) * * Copyright © 2014-2015 Pete Batard * diff --git a/src/bled/bled.h b/src/bled/bled.h index 4f2af41c..fec3b4a8 100644 --- a/src/bled/bled.h +++ b/src/bled/bled.h @@ -1,5 +1,5 @@ /* - * Bled (Busybox Library for Easy Decompression) + * Bled (Base Library for Easy Decompression) * * Copyright © 2014-2015 Pete Batard * diff --git a/src/bled/data_extract_all.c b/src/bled/data_extract_all.c index 3961ebef..3a4e7974 100644 --- a/src/bled/data_extract_all.c +++ b/src/bled/data_extract_all.c @@ -52,7 +52,7 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle) goto ret; } /* Proceed with deleting */ - if (unlink(file_header->name) == -1 + if (_unlink(file_header->name) == -1 && errno != ENOENT ) { bb_perror_msg_and_die("can't remove old file %s", @@ -78,7 +78,7 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle) data_skip(archive_handle); goto ret; } - else if ((unlink(file_header->name) == -1) && (errno != EISDIR)) { + else if ((_unlink(file_header->name) == -1) && (errno != EISDIR)) { bb_perror_msg_and_die("can't remove old file %s", file_header->name); } @@ -116,12 +116,11 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle) /* rpm-style temp file name */ dst_name = xasprintf("%s;%x", dst_name, (int)getpid()); #endif - dst_fd = open(dst_name, flags, file_header->mode); - if (dst_fd < 0) { + if (_sopen_s(&dst_fd, dst_name, flags, _SH_DENYNO, file_header->mode) != 0) { bb_perror_msg_and_die("can't open file %s", dst_name); } bb_copyfd_exact_size(archive_handle->src_fd, dst_fd, file_header->size); - close(dst_fd); + _close(dst_fd); #ifdef ARCHIVE_REPLACE_VIA_RENAME if (archive_handle->ah_flags & ARCHIVE_REPLACE_VIA_RENAME) { xrename(dst_name, file_header->name); @@ -192,7 +191,7 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle) * it has lchmod which seems to do nothing! * so we use chmod... */ if (!(archive_handle->ah_flags & ARCHIVE_DONT_RESTORE_PERM)) { - (void)chmod(file_header->name, file_header->mode); + (void)_chmod(file_header->name, file_header->mode); } if (archive_handle->ah_flags & ARCHIVE_RESTORE_DATE) { struct timeval t[2]; diff --git a/src/bled/decompress_gunzip.c b/src/bled/decompress_gunzip.c index ec67cd36..d5456fed 100644 --- a/src/bled/decompress_gunzip.c +++ b/src/bled/decompress_gunzip.c @@ -919,6 +919,7 @@ static int inflate_block(STATE_PARAM smallint *e) } default: abort_unzip(PASS_STATE_ONLY); + return 0; } } diff --git a/src/bled/libbb.h b/src/bled/libbb.h index 0b123eec..b427eaae 100644 --- a/src/bled/libbb.h +++ b/src/bled/libbb.h @@ -1,7 +1,7 @@ /* - * Library header for busybox + * Library header for busybox/Bled * - * Rewritten for Bled (Busybox Library for Easy Decompression) + * Rewritten for Bled (Base Library for Easy Decompression) * Copyright © 2014-2015 Pete Batard * * Licensed under GPLv2 or later, see file LICENSE in this source tree. @@ -20,9 +20,6 @@ #error Only Windows platforms are supported #endif -#if defined(_MSC_VER) -#pragma warning(disable: 4715) // not all control paths return a value -#pragma warning(disable: 4996) // Ignore deprecated #if defined(DDKBUILD) #pragma warning(disable: 4242) // "Conversion from x to y, possible loss of data" #pragma warning(disable: 4244) @@ -31,7 +28,6 @@ struct timeval { long tv_usec; }; #endif -#endif #include "platform.h" #include "msapi_utf8.h" @@ -197,7 +193,12 @@ static inline int full_read(int fd, void *buf, size_t count) { } static inline struct tm *localtime_r(const time_t *timep, struct tm *result) { +#if defined(DDKBUILD) result = localtime(timep); +#else + if (localtime_s(result, timep) != 0) + result = NULL; +#endif return result; } diff --git a/src/msapi_utf8.h b/src/msapi_utf8.h index 7fae6a55..4f98e4a7 100644 --- a/src/msapi_utf8.h +++ b/src/msapi_utf8.h @@ -802,7 +802,7 @@ static __inline char* getenvU(const char* varname) wchar_t value[256]; size_t value_size; // MinGW and WDK don't know wdupenv_s, so we use wgetenv_s - _wgetenv_s(&value_size, value, sizeof(value), wvarname); + _wgetenv_s(&value_size, value, ARRAYSIZE(value), wvarname); ret = wchar_to_utf8(value); wfree(varname); return ret; diff --git a/src/rufus.rc b/src/rufus.rc index a8c67635..4b6a30fa 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -32,7 +32,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 242, 376 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Rufus 2.4.724" +CAPTION "Rufus 2.4.725" FONT 8, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8 @@ -317,8 +317,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,4,724,0 - PRODUCTVERSION 2,4,724,0 + FILEVERSION 2,4,725,0 + PRODUCTVERSION 2,4,725,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -335,13 +335,13 @@ BEGIN BEGIN VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "2.4.724" + VALUE "FileVersion", "2.4.725" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2015 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "2.4.724" + VALUE "ProductVersion", "2.4.725" END END BLOCK "VarFileInfo"