ashkang / jcal

Jalali Calendar Library
http://nongnu.org/jcal
139 stars 24 forks source link

avoid using strncpy() in parsing date string/format in jdate #8

Closed ashkang closed 10 years ago

ashkang commented 10 years ago

strncpy() behaves differently across platforms when it comes to null termination of destination string. On BSDs, null termination of destination string must be done explicitly. Things are in correct order on standard elibc and glibc implementations. It causes incorrect format parsing on BSDs (_BSD_SOURCE). strlcpy() is also non-existent on platforms other than BSDs.