-
Notifications
You must be signed in to change notification settings - Fork 4
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
base: master
Are you sure you want to change the base?
Conversation
The program produces a crash when |
@@ -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] = ""; |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
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. |
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.