Fix completely stupid and idiotiuc sprintfs in isp_inline.h with

with the STRNCAT function.
This commit is contained in:
mjacob 2000-07-04 01:06:23 +00:00
parent 0d344234ff
commit 819828bc50

View File

@ -44,71 +44,54 @@ static INLINE void
isp_prtstst(sp)
ispstatusreq_t *sp;
{
char buf[172], *p = buf;
sprintf(p, "states->");
char buf[172];
buf[0] = 0;
STRNCAT(buf, "states=>", sizeof buf);
if (sp->req_state_flags & RQSF_GOT_BUS) {
p += strlen(p);
sprintf(p, "%s%s", buf, "GOT_BUS ");
STRNCAT(buf, " GOT_BUS", sizeof buf);
}
if (sp->req_state_flags & RQSF_GOT_TARGET) {
p += strlen(p);
sprintf(p, "%s%s", buf, "GOT_TGT ");
STRNCAT(buf, " GOT_TGT", sizeof buf);
}
if (sp->req_state_flags & RQSF_SENT_CDB) {
p += strlen(p);
sprintf(p, "%s%s", buf, "SENT_CDB ");
STRNCAT(buf, " SENT_CDB", sizeof buf);
}
if (sp->req_state_flags & RQSF_XFRD_DATA) {
p += strlen(p);
sprintf(p, "%s%s", buf, "XFRD_DATA ");
STRNCAT(buf, " XFRD_DATA", sizeof buf);
}
if (sp->req_state_flags & RQSF_GOT_STATUS) {
p += strlen(p);
sprintf(p, "%s%s", buf, "GOT_STS ");
STRNCAT(buf, " GOT_STS", sizeof buf);
}
if (sp->req_state_flags & RQSF_GOT_SENSE) {
p += strlen(p);
sprintf(p, "%s%s", buf, "GOT_SNS ");
STRNCAT(buf, " GOT_SNS", sizeof buf);
}
if (sp->req_state_flags & RQSF_XFER_COMPLETE) {
p += strlen(p);
sprintf(p, "%s%s", buf, "XFR_CMPLT ");
STRNCAT(buf, " XFR_CMPLT", sizeof buf);
}
p += strlen(p);
sprintf(p, "%s%s", buf, "\n");
p += strlen(p);
sprintf(p, "%s%s", buf, "status->");
STRNCAT(buf, "\nstatus=>", sizeof buf);
if (sp->req_status_flags & RQSTF_DISCONNECT) {
p += strlen(p);
sprintf(p, "%s%s", buf, "Disconnect ");
STRNCAT(buf, " Disconnect", sizeof buf);
}
if (sp->req_status_flags & RQSTF_SYNCHRONOUS) {
p += strlen(p);
sprintf(p, "%s%s", buf, "Sync_xfr ");
STRNCAT(buf, " Sync_xfr", sizeof buf);
}
if (sp->req_status_flags & RQSTF_PARITY_ERROR) {
p += strlen(p);
sprintf(p, "%s%s", buf, "Parity ");
STRNCAT(buf, " Parity", sizeof buf);
}
if (sp->req_status_flags & RQSTF_BUS_RESET) {
p += strlen(p);
sprintf(p, "%s%s", buf, "Bus_Reset ");
STRNCAT(buf, " Bus_Reset", sizeof buf);
}
if (sp->req_status_flags & RQSTF_DEVICE_RESET) {
p += strlen(p);
sprintf(p, "%s%s", buf, "Device_Reset ");
STRNCAT(buf, " Device_Reset", sizeof buf);
}
if (sp->req_status_flags & RQSTF_ABORTED) {
p += strlen(p);
sprintf(p, "%s%s", buf, "Aborted ");
STRNCAT(buf, " Aborted", sizeof buf);
}
if (sp->req_status_flags & RQSTF_TIMEOUT) {
p += strlen(p);
sprintf(p, "%s%s", buf, "Timeout ");
STRNCAT(buf, " Timeout", sizeof buf);
}
if (sp->req_status_flags & RQSTF_NEGOTIATION) {
p += strlen(p);
sprintf(p, "%s%s", buf, "Negotiation ");
STRNCAT(buf, " Negotiation", sizeof buf);
}
PRINTF(buf, "%s\n", buf);
}