ghaerr / microwindows

The Nano-X Window System
Other
648 stars 92 forks source link

Fixes for string operations #49

Closed djipi closed 3 years ago

djipi commented 3 years ago

1) Fixed a typo error in Readme.md 2) String manipulation fix previously discussed in #45.

Note: There are still some strncpy function used in the code. You may want to replace those by strzcpy.

ghaerr commented 3 years ago

Thanks @djipi!

ghaerr commented 3 years ago

There are still some strncpy function used in the code. You may want to replace those by strzcpy.

Whoops, missed that... The font name copying functions are a little tricky, as Win32 doesn't expect them to be NUL terminated. I assume this last fix was the result of an error with a font name on your platform?

Can you point out a few examples that fail? I see there are others in various places.

djipi commented 3 years ago

I do not have dedicated examples unfortunately; the problem occured during my early test of the port. Basically the string was damaged at my end, and got the error. So, I thought it was probably better to prevent overflow in case of a long and valid string.