From 87f755658bcaba505adeeccfc62af465a1260220 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sat, 6 Jan 2018 01:45:16 +0000 Subject: [PATCH] socketutils.c: use xsprintf instead of snprintf * socketutils.c: Include "xstring.h". (unix_parse_response): Replace snprintf with xsprintf. --- socketutils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/socketutils.c b/socketutils.c index ce4e5249..f2fd09c7 100644 --- a/socketutils.c +++ b/socketutils.c @@ -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'; -- 2.40.0