Skip to content
Snippets Groups Projects
Commit 468b5a09 authored by Victor Kotlyar's avatar Victor Kotlyar
Browse files

Fix snprintf size parameter for some rmcd messages.

The size mismatch worning was found by gcc gcc version 8.2.1.
parent 3a368183
No related branches found
No related tags found
No related merge requests found
......@@ -110,7 +110,7 @@ int rmc_srv_findcart(const struct rmc_srv_rqst_context *const rqst_context) {
unmarshall_LONG (rbp, type);
unmarshall_LONG (rbp, startaddr);
unmarshall_LONG (rbp, nbelem);
snprintf (logbuf, CA_MAXVIDLEN+15, "findcart %s %d", template, nbelem);
snprintf (logbuf, sizeof(template)+15, "findcart %s %d", template, nbelem);
rmc_logreq (func, logbuf);
if (nbelem < 1) {
......
......@@ -277,7 +277,7 @@ int rmc_send_scsi_cmd (
if ((sg_hd->sense_buffer[0] & 0x70) &&
((sg_hd->sense_buffer[2] & 0xE0) == 0 ||
(sg_hd->sense_buffer[2] & 0xF) != 0)) {
char tmp_msgbuf[132];
char tmp_msgbuf[32];
snprintf (tmp_msgbuf, sizeof(tmp_msgbuf), "%s ASC=%X ASCQ=%X",
sk_msg[*(sense+2) & 0xF], *(sense+12), *(sense+13));
tmp_msgbuf[sizeof(tmp_msgbuf) - 1] = '\0';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment