socketutils.c: use xsprintf instead of snprintf

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

View File

@ -46,6 +46,8 @@
# define UNIX_PATH_MAX sizeof(((struct sockaddr_un *) 0)->sun_path)
#endif
#include "xstring.h"
typedef struct {
unsigned long inode;
char *details;
@ -310,7 +312,7 @@ unix_parse_response(const void *data, const int data_len,
char peer_str[3 + sizeof(peer) * 3];
if (peer)
snprintf(peer_str, sizeof(peer_str), "->%u", peer);
xsprintf(peer_str, "->%u", peer);
else
peer_str[0] = '\0';