Skip to content

Commit

Permalink
Use a format string in snprintf() for consistency.
Browse files Browse the repository at this point in the history
This was reported by Radek Malcic when using the userland stack in
combination with MinGW.

MFC after: 1 week
  • Loading branch information
tuexen committed May 12, 2016
1 parent 131c1c2 commit 766ed50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sys/netinet/sctp_indata.c
Original file line number Diff line number Diff line change
Expand Up @@ -2566,7 +2566,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length,
struct mbuf *op_err;
char msg[SCTP_DIAG_INFO_LEN];

snprintf(msg, sizeof(msg), "I-DATA chunk received when DATA was negotiated");
snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated");
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_18;
sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED);
Expand All @@ -2577,7 +2577,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length,
struct mbuf *op_err;
char msg[SCTP_DIAG_INFO_LEN];

snprintf(msg, sizeof(msg), "DATA chunk received when I-DATA was negotiated");
snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated");
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_19;
sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED);
Expand Down

0 comments on commit 766ed50

Please sign in to comment.