]> granicus.if.org Git - strace/commitdiff
socketutils.c: use xsprintf instead of snprintf
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 6 Jan 2018 01:45:16 +0000 (01:45 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 7 Jan 2018 00:05:42 +0000 (00:05 +0000)
* socketutils.c: Include "xstring.h".
(unix_parse_response): Replace snprintf with xsprintf.

socketutils.c

index ce4e524913d50ea940289d668c19d5e6d8b1e304..f2fd09c7165de79d7e00f7607b5358eb7b657ae0 100644 (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';