Skip to content

Commit

Permalink
fix dangling c_str() (#3791)
Browse files Browse the repository at this point in the history
  • Loading branch information
RedBeard0531 authored Jun 8, 2021
1 parent 736ee40 commit 5d46a29
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/android/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ namespace realm {
char buf[BUFSIZ];
int nb_read = 0;

const char* dest_filename = (s_default_realm_directory + '/' + filename).c_str();
if (access(dest_filename, F_OK ) == -1) {
auto dest_filename = s_default_realm_directory + '/' + filename;
if (access(dest_filename.c_str(), F_OK ) == -1) {
// file doesn't exist, copy
FILE* out = fopen(dest_filename, "w");
FILE* out = fopen(dest_filename.c_str(), "w");
while ((nb_read = AAsset_read(asset, buf, BUFSIZ)) > 0) {
fwrite(buf, nb_read, 1, out);
}
Expand Down

0 comments on commit 5d46a29

Please sign in to comment.