*/
#include "defs.h"
+#include "xstring.h"
SYS_FUNC(close)
{
/* +2 chars needed at the end: ']',NUL */
if (outptr < end_outstr - (sizeof(", except [") + sizeof(int)*3 + 2)) {
if (first) {
- outptr += sprintf(outptr, "%s%s [%u",
+ outptr += xsnprintf(outptr,
+ sizeof(outstr) - (outptr - outstr),
+ "%s%s [%u",
sep,
i == 0 ? "in" : i == 1 ? "out" : "except",
j
first = 0;
sep = ", ";
} else {
- outptr += sprintf(outptr, " %u", j);
+ outptr += xsnprintf(outptr,
+ sizeof(outstr) - (outptr - outstr),
+ " %u", j);
}
}
if (--ready_fds == 0)
if (args[4]) {
const char *str = sprint_tv_ts(tcp, args[4]);
if (outptr + sizeof("left ") + strlen(sep) + strlen(str) < end_outstr) {
- outptr += sprintf(outptr, "%sleft %s", sep, str);
+ outptr += xsnprintf(outptr,
+ sizeof(outstr) - (outptr - outstr),
+ "%sleft %s", sep, str);
}
}
*outptr = '\0';