> On 2013/11/21 15:30, Vladimir Támara Patiño wrote: > > Includes patch sent to developer to show position in bigger files, > > and changing strcat with strlcat and sprintf with snprintf. > > we stopped doing those in ports, they are often intrusive and difficult > to handle at update time, plus there have been too many botched conversions. > better to talk to upstream about them. snprintf should be fairly non- > contentious if done correctly, but for the strl* functions many upstreams > will need a fallback mechanism for OS which don't have them.
That's really easy: #define strlcpy(dst, src, dstsize) snprintf(dst, dstsize, "%s", src) There is only one possible quibble here. The return value is int vs size_t. Since anyone using strcat and strcpy is already not doing any range checking, whooptydoo. This is 2013, if they've missed reading bugtraq for the last 10 years you're not going to change their mind now.
