[neomutt-devel] strfcpy() improvement
rich at flatcap.org
Wed Oct 5 01:28:14 CEST 2016
> In fact, I would suggest turning it into a function
I didn't actually consider that.
I was just happy to eliminate 100 false positives from coverity :-)
> Most modern compilers are smart enough to inline such a trivial function.
True. Not that anything in NeoMutt is *that* time-sensitive.
> The more macros we get rid of, the cleaner and safer the code is.
Agreed. Plus the function could be quite simple.
The original macro ran strndup which returns a pointer to 'dest'.
There are 439 uses of strfcpy and none of them use the return value.
However, a quick bit of research shows that using a function this way
isn't considered wise, because the caller can't tell if the string has
I'm open to suggestions (and code)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: not available
More information about the neomutt-devel