On Fri, Oct 12, 2012 at 07:13:43PM -0400, Wietse Venema wrote:

> > So the ADDINT macro should use " %lu" rather than "%lu".
> 
> Just to be safe, should not there be a delimiter between
> string fields, too? That would be the equivalent of " %s".

Those are already NUL delimited. The vstring_memcat includes the
terminating NUL byte. The hash table key is binary not ASCII.

We could for consistency NUL terminate the ints also:

        "%lu%c", (unsigned long) i, '\0'

That way ints don't merge with the start of strings that follow them
either, otherwise we technically need " %lu " to guard on both ends.

In practice such collisions are exceedingly unlikely (I don't think
they've ever happend and likely never will for a real configuration),
but I am not of a fan of keeping it wrong, no matter how improbable.

-- 
        Viktor.

Reply via email to