From e1ee2f21d91ab4537f9add79697be9540ab35281 Mon Sep 17 00:00:00 2001 From: "Kenneth D. Merry" Date: Sat, 20 Apr 2013 14:33:55 +0000 Subject: [PATCH] Fix compilation. Pointy hat to: ken --- sys/cam/scsi/scsi_ch.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c index 03dd5cda384f..a1d0db51f682 100644 --- a/sys/cam/scsi/scsi_ch.c +++ b/sys/cam/scsi/scsi_ch.c @@ -1147,15 +1147,11 @@ copy_element_status(struct ch_softc *softc, ces->ces_designator_length = devid->designator_length; /* * Make sure we are always NUL terminated. The - * buffer should be sized for the maximum - * designator length plus 1, but this will make sure - * there is always a NUL at the end. This won't - * matter for the binary code set, since the user - * will only pay attention to the length field. + * This won't matter for the binary code set, + * since the user will only pay attention to the + * length field. */ - ces->ces_designator[ - MIN(sizeof(ces->ces_designator) - 1, - devid->designator_length)]= '\0'; + ces->ces_designator[devid->designator_length]= '\0'; } if (devid->piv_assoc_designator_type & READ_ELEMENT_STATUS_PIV_SET) {