]> git.proxmox.com Git - mirror_corosync.git/commitdiff
quorumtool: Use full buffer size in snprintf
authorJan Friesse <jfriesse@redhat.com>
Tue, 7 Nov 2017 14:55:30 +0000 (15:55 +0100)
committerJan Friesse <jfriesse@redhat.com>
Wed, 8 Nov 2017 08:09:47 +0000 (09:09 +0100)
Thanks Bin Liu <bliu@suse.com> for this patch.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
tools/corosync-quorumtool.c

index cbb3503495efd505b3e317630e0a364212308846..f5eccf12b257054be02ae4f9e15366ad1bec265a 100644 (file)
@@ -518,7 +518,7 @@ static void display_nodes_data(nodeid_format_t nodeid_format, name_format_t name
                                if (info[i].flags & VOTEQUORUM_INFO_QDEVICE_REGISTERED) {
                                        char buf[10];
 
-                                       snprintf(buf, sizeof(buf) - 1,
+                                       snprintf(buf, sizeof(buf),
                                                 "%s,%s,%s",
                                                 info[i].flags & VOTEQUORUM_INFO_QDEVICE_ALIVE?"A":"NA",
                                                 info[i].flags & VOTEQUORUM_INFO_QDEVICE_CAST_VOTE?"V":"NV",