mmsghdr.c: use xsprintf instead of snprintf

* mmsghdr.c: Include "xstring.h".
(SYS_FUNC(recvmmsg)): Replace snprintf with xsprintf.
This commit is contained in:
Дмитрий Левин 2018-01-06 01:45:16 +00:00
parent 87f755658b
commit 4ba39820f1

View File

@ -30,6 +30,7 @@
#include "defs.h"
#include "msghdr.h"
#include "xstring.h"
#include <limits.h>
static int
@ -240,8 +241,7 @@ SYS_FUNC(recvmmsg)
return 0;
/* timeout on exit */
static char str[sizeof("left") + TIMESPEC_TEXT_BUFSIZE];
snprintf(str, sizeof(str), "left %s",
sprint_timespec(tcp, tcp->u_arg[4]));
xsprintf(str, "left %s", sprint_timespec(tcp, tcp->u_arg[4]));
tcp->auxstr = str;
return RVAL_STR;
}