aboutsummaryrefslogtreecommitdiff
path: root/lib/sg_pr2serr.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sg_pr2serr.c')
-rw-r--r--lib/sg_pr2serr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sg_pr2serr.c b/lib/sg_pr2serr.c
index a7bdeaf2..05ea8e31 100644
--- a/lib/sg_pr2serr.c
+++ b/lib/sg_pr2serr.c
@@ -1256,7 +1256,7 @@ sgj_pr_js_designation_descriptor(sgj_state * jsp, sgj_opaque_p jop,
if (jsp->pr_hex)
sgj_add_nv_hex_bytes(jsp, jop, "scsi_name_string_hexbytes",
ip, dlen);
- snprintf(b, blen, "%s", ip);
+ snprintf(b, blen, "%.*s", dlen, ip);
sgj_add_nv_s(jsp, jop, "scsi_name_string", b);
break;
case 9: /* Protocol specific port identifier */