Function strlcpy_is_not_posix truncated the last character of every s… - #79
Conversation
…tring it copied. Removed the "- 1" in the loop so it copies the entire string.
|
Hello, could you clarify that was the concret effect of this bug ? in what mlx functions ? |
|
ok just saw your issue, but i need to make sure this does not break other things |
|
hey! it's been a while since i made this PR. Seeing that you work at 42 Paris you must be very busy with other stuff so if you want me to take a better look at this and make tests for every call to this function just tell me, i have the time. Sorry if the issue and/or the PR weren't detailed enough, thank you for taking the time to take a look at the issue. |
|
the function strlcpy_is_not_posix() is only used by the function mlx_int_static_line(), which is only used by mlx_xpm_to_image(), which passes the function to mlx_int_parse_xpm() as an argument, it wont break anything else in the library. i added a test to test/main.c to check the mlx_xpm_to_image() function now that it works, it includes the open.xpm file to the code, as writing the raw xpm data in the source file seemed too dirty. I added a comment because otherwise including an xpm file seemed a little bit unintuitive. please, tell me if there is anything i could/should change. |
Fixes #78
Function strlcpy_is_not_posix truncated the last character of every string it copied. Removed the "- 1" in the loop condition so it copies the entire string.
Refer to the issue for a more in-detail description.
My login is ldel-val, slack me if you need to talk about this PR :)