'\" t .\" Title: sanitize_inquiry_string .\" Author: .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: May 2018 .\" Manual: SCSI mid layer .\" Source: Kernel Hackers Manual 3.16.56 .\" Language: English .\" .TH "SANITIZE_INQUIRY_STR" "9" "May 2018" "Kernel Hackers Manual 3\&.16\&" "SCSI mid layer" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" sanitize_inquiry_string \- remove non\-graphical chars from an INQUIRY result string .SH "SYNOPSIS" .HP \w'void\ sanitize_inquiry_string('u .BI "void sanitize_inquiry_string(unsigned\ char\ *\ " "s" ", int\ " "len" ");" .SH "ARGUMENTS" .PP \fIs\fR .RS 4 INQUIRY result string to sanitize .RE .PP \fIlen\fR .RS 4 length of the string .RE .SH "DESCRIPTION" .PP The SCSI spec says that INQUIRY vendor, product, and revision strings must consist entirely of graphic ASCII characters, padded on the right with spaces\&. Since not all devices obey this rule, we will replace non\-graphic or non\-ASCII characters with spaces\&. Exception: a NUL character is interpreted as a string terminator, so all the following characters are set to spaces\&. .SH "AUTHORS" .PP \fBJames Bottomley\fR <\&James.Bottomley@hansenpartnership.com\&> .RS 4 Author. .RE .PP \fBRob Landley\fR <\&rob@landley.net\&> .RS 4 Author. .RE .SH "COPYRIGHT" .br