Skip to content

Commit d17ad28

Browse files
committed
Fixed bad ordering of format string arguments
The expected/actual number of bytes sent/received was supplied to the format string in the wrong order. Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
1 parent 39c1819 commit d17ad28

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

libcfnet/file_stream.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ static bool __ProtocolSendMessage(
120120
Log(LOG_LEVEL_ERR,
121121
"Failed to send message header during file stream: "
122122
"Expected to send %d bytes, but sent %d bytes",
123-
ret,
124-
PROTOCOL_HEADER_SIZE);
123+
PROTOCOL_HEADER_SIZE,
124+
ret);
125125
return false;
126126
}
127127

@@ -133,9 +133,9 @@ static bool __ProtocolSendMessage(
133133
{
134134
Log(LOG_LEVEL_ERR,
135135
"Failed to send message payload during file stream: "
136-
"Expected to send %d bytes, but sent %zu bytes",
137-
ret,
138-
len);
136+
"Expected to send %zu bytes, but sent %d bytes",
137+
len,
138+
ret);
139139
return false;
140140
}
141141
}
@@ -194,8 +194,8 @@ static bool ProtocolRecvMessage(SSL *conn, char *msg, size_t *len, bool *eof)
194194
Log(LOG_LEVEL_ERR,
195195
"Failed to receive message header during file stream: "
196196
"Expected to receive %d bytes, but received %d bytes",
197-
ret,
198-
PROTOCOL_HEADER_SIZE);
197+
PROTOCOL_HEADER_SIZE,
198+
ret);
199199
return false;
200200
}
201201

@@ -233,9 +233,9 @@ static bool ProtocolRecvMessage(SSL *conn, char *msg, size_t *len, bool *eof)
233233
{
234234
Log(LOG_LEVEL_ERR,
235235
"Failed to receive message payload during file stream: "
236-
"Expected to receive %d bytes, but received %zu bytes",
237-
ret,
238-
*len);
236+
"Expected to receive %zu bytes, but received %d bytes",
237+
*len,
238+
ret);
239239
return false;
240240
}
241241
memcpy(msg, recv_buffer, *len);

0 commit comments

Comments
 (0)