Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

149 id in settingsmenu #159

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

149 id in settingsmenu #159

wants to merge 6 commits into from

Conversation

tesourinha
Copy link
Collaborator

To compile, you have to use the config that is in the branch, make sure the key-value pair "Customer_Id": "" exists and set the path to this config in the settingspopup.hpp. In the master version, the key-value pair "Customer_Id": "" needs to be added.

@tesourinha tesourinha linked an issue May 29, 2024 that may be closed by this pull request
@R-Abbasi
Copy link
Collaborator

The program produces a crash when Attitude is clicked.

@@ -20,6 +21,47 @@ static void popup_settings(nlohmann::json &config,
ImGui::Text(appLanguage[Key::SettingsText]);
ImGui::Text(" ");

// Create and initialize customer_id variable
static char customer_id[20] = "";
Copy link
Collaborator

@R-Abbasi R-Abbasi May 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static primitive data types are zero initialized by default. So you could define them like static char customer_id[20];, static bool isEmpty; and so forth. Of course being explicit here can be fine.
Moreover, you could have the size unsigned sz/size {20}; and use it for the array and others if needed.

if (temp.empty()) {
isempty = true;
}
customer_id[temp.size()] = '\0'; // Ensure null termination
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you need any bound checking before using the array here, please?

@AKMaily
Copy link
Collaborator

AKMaily commented Jun 3, 2024

The program produces a crash when Attitude is clicked.

this is normal as the config is downloaded from the master in this version, which hasnt the "customer_id" field. This should be fixed when the branch is included in the master. For testing please manually load the config from this branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ID in Settingsmenu
3 participants