summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-volume.c
diff options
context:
space:
mode:
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
-rw-r--r--cli/src/cli-cmd-volume.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index 3f76b6150da..ea7a13761e3 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -1588,7 +1588,7 @@ cli_print_brick_status (cli_volume_status_t *status)
while (bricklen > 0) {
if (bricklen > fieldlen) {
i++;
- strncpy (buf, p, fieldlen);
+ strncpy (buf, p, min (fieldlen, (sizeof (buf)-1)));
buf[strlen(buf) + 1] = '\0';
cli_out ("%s", buf);
p = status->brick + i * fieldlen;