Fix incorrect output when offset attribute is unset.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
if (hash->offset) {
- ret = snprintf(buf, len, "offset %u ", hash->offset);
+ ret = snprintf(buf + offset, len, "offset %u ", hash->offset);
SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
}
}
if (ng->offset) {
- ret = snprintf(buf, len, "offset %u ", ng->offset);
+ ret = snprintf(buf + offset, len, "offset %u ", ng->offset);
SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
}