summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2000-07-04 01:06:23 +0000
committermjacob <mjacob@FreeBSD.org>2000-07-04 01:06:23 +0000
commit8df34aede70d6e6cc5c47299c8c57f92366771e3 (patch)
tree026965b3db221aadc525330ff06200bd0c54e66a
parente0a8dae616ce837fcb0a631c17d35ef5deb6d5e1 (diff)
downloadFreeBSD-src-8df34aede70d6e6cc5c47299c8c57f92366771e3.zip
FreeBSD-src-8df34aede70d6e6cc5c47299c8c57f92366771e3.tar.gz
Fix completely stupid and idiotiuc sprintfs in isp_inline.h with
with the STRNCAT function.
-rw-r--r--sys/dev/isp/isp_inline.h55
1 files changed, 19 insertions, 36 deletions
diff --git a/sys/dev/isp/isp_inline.h b/sys/dev/isp/isp_inline.h
index e59d277..c6be127 100644
--- a/sys/dev/isp/isp_inline.h
+++ b/sys/dev/isp/isp_inline.h
@@ -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);
}
OpenPOWER on IntegriCloud