This change does not break ABI.
This change does not break API, except for parameter error when replace is NULL.
f_status_t f_file_mode_from_string(const f_string_static_t code, const mode_t umask, f_file_mode_t * const mode, uint8_t * const replace) {
#ifndef _di_level_0_parameter_checking_
if (!mode) return F_status_set_error(F_parameter);
- if (!replace) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!code.used) return F_data_not;
if (syntax) {
*mode = mode_result;
- *replace = replace_result;
+
+ if (replace) {
+ *replace = replace_result;
+ }
return F_none;
}
*
* See the f_file_mode_t documentation for details.
* @param replace
- * The determined modes that are to be replaced, such as: F_file_mode_t_replace_owner_d.
+ * (optional) The determined modes that are to be replaced, such as: F_file_mode_t_replace_owner_d.
* This uses bitwise data.
*
* The flags F_file_mode_t_replace_* are used to designate which mask bits are to be replaced.
*
* Replacements replace the entire existing mode values where as "add" and "subtract" add or subtract modes, respectively, to the existing mode values.
*
+ * Set to NULL to not use.
+ *
* @return
* F_none on success.
*
}
{
- f_file_mode_t mode_file = f_file_mode_t_initialize;
-
- const f_status_t status = f_file_mode_from_string(f_string_empty_s, 0, &mode_file, 0);
-
- assert_int_equal(status, F_status_set_error(F_parameter));
- }
-
- {
uint8_t replace = 0;
const f_status_t status = f_file_mode_from_string(f_string_empty_s, 0, 0, &replace);
assert_int_equal(F_status_set_fine(status), F_data_not);
}
+
+ {
+ f_file_mode_t mode_file = f_file_mode_t_initialize;
+
+ const f_status_t status = f_file_mode_from_string(f_string_empty_s, 0, &mode_file, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_data_not);
+ }
}
void test__f_file_mode_from_string__works_basic_alphabet(void **state) {