aboutsummaryrefslogtreecommitdiff
path: root/lib/test_fortify/write_overflow-strncpy-src.c
diff options
context:
space:
mode:
authorIlpo Järvinen <[email protected]>2023-07-17 16:15:02 +0300
committerShuah Khan <[email protected]>2023-07-25 08:53:42 -0600
commitf4123975cf341fd12121e1631c4b172a190f48d4 (patch)
treea3496cee68794018e93c2b86a10133721e7eae4d /lib/test_fortify/write_overflow-strncpy-src.c
parent5e3e4f1a03f075bd49104ea4c998c20649a49491 (diff)
selftests/resctrl: Improve parameter consistency in fill_buf
fill_buf's arguments can be improved in multiple ways: - Multiple functions in fill_buf have start_ptr as one of their argument which is a bit long and the extra "start" is pretty obvious when it comes to pointers. - Some of the functions take end_ptr and others size_t to indicate the end of the buffer. - Some arguments meaning buffer size are called just 's' - mem_flush() takes void * but immediately converts it to char * Cleanup the parameters to make things simpler and more consistent: - Rename start_ptr to simply buf as it's shorter. - Replace end_ptr and s parameters with buf_size and only calculate end_ptr in the functions that truly use it. - Make mem_flush() parameters to follow the same convention as the other functions in fill_buf. - convert mem_flush() char * to unsigned char *. While at it, fix also a typo in a comment. Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Tested-by: Babu Moger <[email protected]> Tested-by: Shaopeng Tan (Fujitsu) <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions