[cvs] bogofilter/src word.h,1.17,1.18

Matthias Andree matthias.andree at gmx.de
Mon Mar 14 00:50:30 CET 2005


David Relson <relson at users.sourceforge.net> writes:

>  /** create a new word_t from the NUL-terminated \a cstring */
> -#define word_news(cstring) word_new((cstring), strlen((const char *)(cstring)));
> +#define word_news(cstring) word_new(cstring, 0)

Dangerous. It is common practice to always include macro expansions into
parentheses, to avoid trouble when someone stuffs special characters
such as commas into the macro call that might goof up the RHS of the
expansion. As written in the other mail, there is no longer reason to
keep the "len == 0" special treatment, we can just take the second
word_new() length argument straight in and use it. Gratuitous strlen()
calls are slow, particularly in such low-level functions.

-- 
Matthias Andree
_______________________________________________
Bogofilter-dev mailing list
Bogofilter-dev at bogofilter.org
http://www.bogofilter.org/mailman/listinfo/bogofilter-dev



More information about the bogofilter-dev mailing list