On 12 May 2014 17:54, Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote: > You can use malloc instead. Just make sure that the string is always > nul-terminated before printing, something like: > > bufsiz = ret + 1; > buf = malloc(1, bufsiz); > if (buf == NULL) > return -1; > > ret = snprintf(... > if (ret < 0) > ... > } > > buf[ret] = '\0'; > ... = fprintf(... > >From my man pages, I understand that snprintf() null-terminate the string. This seems a bit redundant. I think it's safe to don't include calloc() neither buf[ret] = '\0'. I'm resending this patch with this assumption and your other request. regards. -- Arturo Borrero González -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html