diff options
Diffstat (limited to '3rdParty/Breakpad/src/common/mac/file_id.cc')
-rw-r--r-- | 3rdParty/Breakpad/src/common/mac/file_id.cc | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/3rdParty/Breakpad/src/common/mac/file_id.cc b/3rdParty/Breakpad/src/common/mac/file_id.cc index 50502e4..4661d5d 100644 --- a/3rdParty/Breakpad/src/common/mac/file_id.cc +++ b/3rdParty/Breakpad/src/common/mac/file_id.cc @@ -36,2 +36,3 @@ #include <fcntl.h> +#include <stdio.h> #include <string.h> @@ -47,3 +48,3 @@ namespace google_breakpad { FileID::FileID(const char *path) { - strlcpy(path_, path, sizeof(path_)); + snprintf(path_, sizeof(path_), "%s", path); } @@ -63,3 +64,3 @@ bool FileID::FileIdentifier(unsigned char identifier[16]) { while ((buffer_size = read(fd, buffer, buffer_size) > 0)) { - MD5Update(&md5, buffer, buffer_size); + MD5Update(&md5, buffer, static_cast<unsigned>(buffer_size)); } @@ -72,9 +73,11 @@ bool FileID::FileIdentifier(unsigned char identifier[16]) { -bool FileID::MachoIdentifier(int cpu_type, unsigned char identifier[16]) { +bool FileID::MachoIdentifier(cpu_type_t cpu_type, + cpu_subtype_t cpu_subtype, + unsigned char identifier[16]) { MachoID macho(path_); - if (macho.UUIDCommand(cpu_type, identifier)) + if (macho.UUIDCommand(cpu_type, cpu_subtype, identifier)) return true; - return macho.MD5(cpu_type, identifier); + return macho.MD5(cpu_type, cpu_subtype, identifier); } @@ -92,4 +95,6 @@ void FileID::ConvertIdentifierToString(const unsigned char identifier[16], - buffer[buffer_idx++] = (hi >= 10) ? 'A' + hi - 10 : '0' + hi; - buffer[buffer_idx++] = (lo >= 10) ? 'A' + lo - 10 : '0' + lo; + buffer[buffer_idx++] = + static_cast<char>((hi >= 10) ? ('A' + hi - 10) : ('0' + hi)); + buffer[buffer_idx++] = + static_cast<char>((lo >= 10) ? ('A' + lo - 10) : ('0' + lo)); } |