diff --git a/example/scp_write.c b/example/scp_write.c index 7ced6c0d..55cf6250 100644 --- a/example/scp_write.c +++ b/example/scp_write.c @@ -187,7 +187,6 @@ int main(int argc, char *argv[]) nread -= (size_t)nwritten; } } while(nread); - } while(1); fprintf(stderr, "Sending EOF\n"); diff --git a/example/sftp_RW_nonblock.c b/example/sftp_RW_nonblock.c index 0d994e7d..776a7d6c 100644 --- a/example/sftp_RW_nonblock.c +++ b/example/sftp_RW_nonblock.c @@ -276,7 +276,6 @@ int main(int argc, char *argv[]) fprintf(stderr, "SFTP download timed out: %d\n", rc); break; } - } while(1); libssh2_sftp_close(sftp_handle); diff --git a/example/sftp_append.c b/example/sftp_append.c index f7ff7c71..df73c9c5 100644 --- a/example/sftp_append.c +++ b/example/sftp_append.c @@ -216,7 +216,6 @@ int main(int argc, char *argv[]) ptr += nwritten; nread -= (size_t)nwritten; } while(nread); - } while(nwritten > 0); libssh2_sftp_close(sftp_handle); diff --git a/example/ssh2_agent_forwarding.c b/example/ssh2_agent_forwarding.c index 4d1e9412..1be35216 100644 --- a/example/ssh2_agent_forwarding.c +++ b/example/ssh2_agent_forwarding.c @@ -251,8 +251,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "libssh2_channel_read returned %ld\n", (long)nread); } - } - while(nread > 0); + } while(nread > 0); /* this is due to blocking that would occur otherwise so we loop on this condition */ diff --git a/example/ssh2_exec.c b/example/ssh2_exec.c index 8191210a..ee8d2fb9 100644 --- a/example/ssh2_exec.c +++ b/example/ssh2_exec.c @@ -262,8 +262,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "libssh2_channel_read returned %ld\n", (long)nread); } - } - while(nread > 0); + } while(nread > 0); /* this is due to blocking that would occur otherwise so we loop on this condition */ diff --git a/src/pem.c b/src/pem.c index c6588968..be7d9384 100644 --- a/src/pem.c +++ b/src/pem.c @@ -126,8 +126,7 @@ _libssh2_pem_parse(LIBSSH2_SESSION * session, if(readline(line, LINE_SIZE, fp)) { return -1; } - } - while(strcmp(line, headerbegin) != 0); + } while(strcmp(line, headerbegin) != 0); if(readline(line, LINE_SIZE, fp)) { return -1; @@ -323,8 +322,7 @@ _libssh2_pem_parse_memory(LIBSSH2_SESSION * session, if(readline_memory(line, LINE_SIZE, filedata, filedata_len, &off)) { return -1; } - } - while(strcmp(line, headerbegin) != 0); + } while(strcmp(line, headerbegin) != 0); *line = '\0'; @@ -722,8 +720,7 @@ _libssh2_openssh_pem_parse(LIBSSH2_SESSION * session, if(readline(line, LINE_SIZE, fp)) { return -1; } - } - while(strcmp(line, OPENSSH_HEADER_BEGIN) != 0); + } while(strcmp(line, OPENSSH_HEADER_BEGIN) != 0); if(readline(line, LINE_SIZE, fp)) { return -1; @@ -803,8 +800,7 @@ _libssh2_openssh_pem_parse_memory(LIBSSH2_SESSION * session, if(readline_memory(line, LINE_SIZE, filedata, filedata_len, &off)) { return -1; } - } - while(strcmp(line, OPENSSH_HEADER_BEGIN) != 0); + } while(strcmp(line, OPENSSH_HEADER_BEGIN) != 0); *line = '\0'; diff --git a/src/scp.c b/src/scp.c index 0900655a..8a8e7d9e 100644 --- a/src/scp.c +++ b/src/scp.c @@ -784,7 +784,7 @@ scp_recv_error: tmp_err_code = session->err_code; tmp_err_msg = session->err_msg; while(libssh2_channel_free(session->scpRecv_channel) == - LIBSSH2_ERROR_EAGAIN); + LIBSSH2_ERROR_EAGAIN); session->err_code = tmp_err_code; session->err_msg = tmp_err_msg; session->scpRecv_channel = NULL;