Chromium Code Reviews| Index: third_party/android_crazy_linker/src/src/crazy_linker_api.cpp |
| diff --git a/third_party/android_crazy_linker/src/src/crazy_linker_api.cpp b/third_party/android_crazy_linker/src/src/crazy_linker_api.cpp |
| index 8a83adfe2a0d162737315b0e3e705ec8e7045dba..08be94ba7010395fba253040786977cd2b1d1b0a 100644 |
| --- a/third_party/android_crazy_linker/src/src/crazy_linker_api.cpp |
| +++ b/third_party/android_crazy_linker/src/src/crazy_linker_api.cpp |
| @@ -372,6 +372,19 @@ crazy_status_t crazy_library_find_from_address(void* address, |
| } |
| } |
| +crazy_status_t crazy_library_filename_in_zip_file(const char* lib_name, |
| + char* buffer, |
| + size_t buffer_size) { |
| + crazy::String file_name = crazy::LibraryList::GetLibraryFilenameInZipFile( |
| + lib_name); |
| + if (file_name.size() >= buffer_size) { |
|
picksi1
2014/10/30 10:48:08
For discussion/thought: should the failure mode he
petrcermak
2014/10/30 19:55:07
I would personally keep it as is - the function do
|
| + return CRAZY_STATUS_FAILURE; |
| + } |
| + |
| + strncpy(buffer, file_name.c_str(), file_name.size() + 1); |
|
picksi1
2014/10/30 10:48:08
generally strncpy() would get the sizeof(buffer) p
petrcermak
2014/10/30 19:55:07
I use "file_name.size() + 1" here because I know t
|
| + return CRAZY_STATUS_SUCCESS; |
| +} |
| + |
| crazy_status_t crazy_linker_check_library_aligned_in_zip_file( |
| const char* zipfile_name, |
| const char* lib_name) { |