Skip to content

Commit 67d2a8d

Browse files
committed
Address code review feedback on remote_config desktop implementation
1 parent 5774ae0 commit 67d2a8d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

remote_config/src/desktop/file_manager.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ namespace internal {
3636

3737
RemoteConfigFileManager::RemoteConfigFileManager(const std::string& filename,
3838
const firebase::App& app) {
39+
const char* package_name = app.options().package_name();
3940
std::string app_data_prefix =
40-
std::string(app.options().package_name()) + "/remote_config";
41+
std::string(package_name ? package_name : "") + "/remote_config";
4142
std::string error;
4243
std::string app_dir =
4344
AppDataDir(app_data_prefix.c_str(), /*should_create=*/true, &error);

remote_config/src/desktop/metadata.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ void RemoteConfigMetadata::Deserialize(const std::string& buffer) {
8585
const char* key_str = settings.Keys()[i].AsKey();
8686
if (!key_str) continue;
8787
char* endptr = nullptr;
88+
errno = 0;
8889
long raw_key = std::strtol(key_str, &endptr, 10);
89-
if (endptr == key_str || *endptr != '\0') {
90+
if (endptr == key_str || *endptr != '\0' || errno == ERANGE) {
9091
continue;
9192
}
9293
if (raw_key < std::numeric_limits<int>::min() ||

0 commit comments

Comments
 (0)