{
int (*opener)(UI *ui) = UI_method_get_opener(ui_fallback_method);
- if (opener)
+ if (opener != NULL)
return opener(ui);
return 1;
}
{
const char *password =
((PW_CB_DATA *)UI_get0_user_data(ui))->password;
- if (password && password[0] != '\0') {
+
+ if (password != NULL) {
UI_set_result(ui, uis, password);
return 1;
}
}
reader = UI_method_get_reader(ui_fallback_method);
- if (reader)
+ if (reader != NULL)
return reader(ui, uis);
+ /* Default to the empty password if we've got nothing better */
+ UI_set_result(ui, uis, "");
return 1;
}
}
writer = UI_method_get_writer(ui_fallback_method);
- if (writer)
+ if (writer != NULL)
return writer(ui, uis);
return 1;
}
{
int (*closer)(UI *ui) = UI_method_get_closer(ui_fallback_method);
- if (closer)
+ if (closer != NULL)
return closer(ui);
return 1;
}
void destroy_ui_method(void)
{
- if (ui_method) {
+ if (ui_method != NULL) {
UI_destroy_method(ui_method);
ui_method = NULL;
}