There's nothing better that can be done.
Cc: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
+#include <stdlib.h>
#include <sys/types.h>
#include "attr.h"
{
int len;
+ if (size == 0)
+ abort();
+
len = vsnprintf(s, size, fmt, ap);
if (len == -1)
return -1;
#include <errno.h>
#include <stdbool.h>
#include <stddef.h>
+#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
size_t dlen, slen;
if (dsize == 0)
- return -1;
+ abort();
slen = strnlen(src, dsize);
trunc = (slen == dsize);