fix printf format warning

uint32_t should be formated by PRI?32

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Change-Id: I811cfd764010f9e8bb599b370155ac065ee1905c
This commit is contained in:
Xiang Xiao
2022-03-16 17:08:37 +08:00
committed by Jakub Jelen
parent 346e6db318
commit b53d0608b6
12 changed files with 71 additions and 76 deletions

View File

@@ -178,7 +178,7 @@ SSH_PACKET_CALLBACK(ssh_packet_channel_open_conf){
channel=ssh_channel_from_local(session,channelid);
if(channel==NULL){
ssh_set_error(session, SSH_FATAL,
"Unknown channel id %"PRIu32,
"Unknown channel id %" PRIu32,
(uint32_t) channelid);
/* TODO: Set error marking in channel object */
@@ -193,7 +193,7 @@ SSH_PACKET_CALLBACK(ssh_packet_channel_open_conf){
goto error;
SSH_LOG(SSH_LOG_DEBUG,
"Received a CHANNEL_OPEN_CONFIRMATION for channel %d:%d",
"Received a CHANNEL_OPEN_CONFIRMATION for channel %" PRId32 ":%" PRId32,
channel->local_channel,
channel->remote_channel);
@@ -206,7 +206,7 @@ SSH_PACKET_CALLBACK(ssh_packet_channel_open_conf){
}
SSH_LOG(SSH_LOG_DEBUG,
"Remote window : %"PRIu32", maxpacket : %"PRIu32,
"Remote window : %" PRIu32 ", maxpacket : %" PRIu32,
(uint32_t) channel->remote_window,
(uint32_t) channel->remote_maxpacket);
@@ -255,7 +255,7 @@ SSH_PACKET_CALLBACK(ssh_packet_channel_open_fail){
}
ssh_set_error(session, SSH_REQUEST_DENIED,
"Channel opening failure: channel %u error (%"PRIu32") %s",
"Channel opening failure: channel %" PRIu32 " error (%" PRIu32 ") %s",
channel->local_channel,
(uint32_t) code,
error);
@@ -328,7 +328,7 @@ channel_open(ssh_channel channel,
channel->local_window = window;
SSH_LOG(SSH_LOG_DEBUG,
"Creating a channel %d with %d window and %d max packet",
"Creating a channel %" PRId32 " with %" PRId32 " window and %" PRId32 " max packet",
channel->local_channel, window, maxpacket);
rc = ssh_buffer_pack(session->out_buffer,
@@ -356,7 +356,7 @@ channel_open(ssh_channel channel,
}
SSH_LOG(SSH_LOG_PACKET,
"Sent a SSH_MSG_CHANNEL_OPEN type %s for channel %d",
"Sent a SSH_MSG_CHANNEL_OPEN type %s for channel %" PRId32,
type, channel->local_channel);
pending:
@@ -418,7 +418,7 @@ static int grow_window(ssh_session session,
if (new_window <= channel->local_window) {
SSH_LOG(SSH_LOG_DEBUG,
"growing window (channel %d:%d) to %d bytes : not needed (%d bytes)",
"growing window (channel %" PRId32 ":%" PRId32 ") to %" PRId32 " bytes : not needed (%" PRId32 " bytes)",
channel->local_channel, channel->remote_channel, new_window,
channel->local_window);
@@ -442,7 +442,7 @@ static int grow_window(ssh_session session,
}
SSH_LOG(SSH_LOG_DEBUG,
"growing window (channel %d:%d) to %d bytes",
"growing window (channel %" PRId32 ":%" PRId32 ") to %" PRId32 " bytes",
channel->local_channel,
channel->remote_channel,
new_window);
@@ -485,7 +485,7 @@ static ssh_channel channel_from_msg(ssh_session session, ssh_buffer packet)
channel = ssh_channel_from_local(session, chan);
if (channel == NULL) {
ssh_set_error(session, SSH_FATAL,
"Server specified invalid channel %"PRIu32,
"Server specified invalid channel %" PRIu32,
(uint32_t) chan);
}
@@ -513,7 +513,7 @@ SSH_PACKET_CALLBACK(channel_rcv_change_window) {
}
SSH_LOG(SSH_LOG_DEBUG,
"Adding %d bytes to channel (%d:%d) (from %d bytes)",
"Adding %" PRId32 " bytes to channel (%" PRId32 ":%" PRId32 ") (from %" PRId32 " bytes)",
bytes,
channel->local_channel,
channel->remote_channel,
@@ -562,7 +562,7 @@ SSH_PACKET_CALLBACK(channel_rcv_data){
len = ssh_string_len(str);
SSH_LOG(SSH_LOG_PACKET,
"Channel receiving %u bytes data in %d (local win=%d remote win=%d)",
"Channel receiving %" PRIu32 " bytes data in %d (local win=%" PRId32 " remote win=%" PRId32 ")",
len,
is_stderr,
channel->local_window,
@@ -571,7 +571,7 @@ SSH_PACKET_CALLBACK(channel_rcv_data){
/* What shall we do in this case? Let's accept it anyway */
if (len > channel->local_window) {
SSH_LOG(SSH_LOG_RARE,
"Data packet too big for our window(%u vs %d)",
"Data packet too big for our window(%" PRIu32 " vs %" PRId32 ")",
len,
channel->local_window);
}
@@ -590,7 +590,7 @@ SSH_PACKET_CALLBACK(channel_rcv_data){
}
SSH_LOG(SSH_LOG_PACKET,
"Channel windows are now (local win=%d remote win=%d)",
"Channel windows are now (local win=%" PRId32 " remote win=%" PRId32 ")",
channel->local_window,
channel->remote_window);
@@ -644,7 +644,7 @@ SSH_PACKET_CALLBACK(channel_rcv_eof) {
}
SSH_LOG(SSH_LOG_PACKET,
"Received eof on channel (%d:%d)",
"Received eof on channel (%" PRId32 ":%" PRId32 ")",
channel->local_channel,
channel->remote_channel);
/* channel->remote_window = 0; */
@@ -689,7 +689,7 @@ SSH_PACKET_CALLBACK(channel_rcv_close) {
}
SSH_LOG(SSH_LOG_PACKET,
"Received close on channel (%d:%d)",
"Received close on channel (%" PRId32 ":%" PRId32 ")",
channel->local_channel,
channel->remote_channel);
@@ -916,7 +916,7 @@ int channel_default_bufferize(ssh_channel channel,
}
SSH_LOG(SSH_LOG_PACKET,
"placing %u bytes into channel buffer (%s)",
"placing %" PRIu32 " bytes into channel buffer (%s)",
len,
is_stderr ? "stderr" : "stdout");
if (!is_stderr) {
@@ -1306,7 +1306,7 @@ int ssh_channel_send_eof(ssh_channel channel)
rc = ssh_packet_send(session);
SSH_LOG(SSH_LOG_PACKET,
"Sent a EOF on client channel (%d:%d)",
"Sent a EOF on client channel (%" PRId32 ":%" PRId32 ")",
channel->local_channel,
channel->remote_channel);
if (rc != SSH_OK) {
@@ -1371,7 +1371,7 @@ int ssh_channel_close(ssh_channel channel)
rc = ssh_packet_send(session);
SSH_LOG(SSH_LOG_PACKET,
"Sent a close on client channel (%d:%d)",
"Sent a close on client channel (%" PRId32 ":%" PRId32 ")",
channel->local_channel,
channel->remote_channel);
@@ -1454,7 +1454,7 @@ static int channel_write_common(ssh_channel channel,
if (len > INT_MAX) {
SSH_LOG(SSH_LOG_TRACE,
"Length (%u) is bigger than INT_MAX", len);
"Length (%" PRIu32 ") is bigger than INT_MAX", len);
return SSH_ERROR;
}
@@ -1466,7 +1466,7 @@ static int channel_write_common(ssh_channel channel,
if (channel->local_eof) {
ssh_set_error(session, SSH_REQUEST_DENIED,
"Can't write to channel %d:%d after EOF was sent",
"Can't write to channel %" PRId32 ":%" PRId32 " after EOF was sent",
channel->local_channel,
channel->remote_channel);
return -1;
@@ -1491,7 +1491,7 @@ static int channel_write_common(ssh_channel channel,
while (len > 0) {
if (channel->remote_window < len) {
SSH_LOG(SSH_LOG_DEBUG,
"Remote window is %d bytes. going to write %d bytes",
"Remote window is %" PRId32 " bytes. going to write %" PRId32 " bytes",
channel->remote_window,
len);
/* What happens when the channel window is zero? */
@@ -1705,7 +1705,7 @@ SSH_PACKET_CALLBACK(ssh_packet_channel_success){
}
SSH_LOG(SSH_LOG_PACKET,
"Received SSH_CHANNEL_SUCCESS on channel (%d:%d)",
"Received SSH_CHANNEL_SUCCESS on channel (%" PRId32 ":%" PRId32 ")",
channel->local_channel,
channel->remote_channel);
if(channel->request_state != SSH_CHANNEL_REQ_STATE_PENDING){
@@ -1736,7 +1736,7 @@ SSH_PACKET_CALLBACK(ssh_packet_channel_failure){
}
SSH_LOG(SSH_LOG_PACKET,
"Received SSH_CHANNEL_FAILURE on channel (%d:%d)",
"Received SSH_CHANNEL_FAILURE on channel (%" PRId32 ":%" PRId32 ")",
channel->local_channel,
channel->remote_channel);
if(channel->request_state != SSH_CHANNEL_REQ_STATE_PENDING){
@@ -3007,7 +3007,7 @@ int ssh_channel_read_timeout(ssh_channel channel,
* as asked
*/
SSH_LOG(SSH_LOG_PACKET,
"Read (%d) buffered : %d bytes. Window: %d",
"Read (%" PRId32 ") buffered : %" PRId32 " bytes. Window: %" PRId32,
count,
ssh_buffer_get_len(stdbuf),
channel->local_window);