1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-07-29 13:01:14 +03:00

tidy-up: do/while formatting

Also fix an indentation and delete empty lines.

Closes #1440
This commit is contained in:
Viktor Szakats
2024-08-06 04:05:17 +02:00
parent 8ae1b2d742
commit 29a4b607d8
7 changed files with 7 additions and 16 deletions

View File

@ -187,7 +187,6 @@ int main(int argc, char *argv[])
nread -= (size_t)nwritten; nread -= (size_t)nwritten;
} }
} while(nread); } while(nread);
} while(1); } while(1);
fprintf(stderr, "Sending EOF\n"); fprintf(stderr, "Sending EOF\n");

View File

@ -276,7 +276,6 @@ int main(int argc, char *argv[])
fprintf(stderr, "SFTP download timed out: %d\n", rc); fprintf(stderr, "SFTP download timed out: %d\n", rc);
break; break;
} }
} while(1); } while(1);
libssh2_sftp_close(sftp_handle); libssh2_sftp_close(sftp_handle);

View File

@ -216,7 +216,6 @@ int main(int argc, char *argv[])
ptr += nwritten; ptr += nwritten;
nread -= (size_t)nwritten; nread -= (size_t)nwritten;
} while(nread); } while(nread);
} while(nwritten > 0); } while(nwritten > 0);
libssh2_sftp_close(sftp_handle); libssh2_sftp_close(sftp_handle);

View File

@ -251,8 +251,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "libssh2_channel_read returned %ld\n", fprintf(stderr, "libssh2_channel_read returned %ld\n",
(long)nread); (long)nread);
} }
} } while(nread > 0);
while(nread > 0);
/* this is due to blocking that would occur otherwise so we loop on /* this is due to blocking that would occur otherwise so we loop on
this condition */ this condition */

View File

@ -262,8 +262,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "libssh2_channel_read returned %ld\n", fprintf(stderr, "libssh2_channel_read returned %ld\n",
(long)nread); (long)nread);
} }
} } while(nread > 0);
while(nread > 0);
/* this is due to blocking that would occur otherwise so we loop on /* this is due to blocking that would occur otherwise so we loop on
this condition */ this condition */

View File

@ -126,8 +126,7 @@ _libssh2_pem_parse(LIBSSH2_SESSION * session,
if(readline(line, LINE_SIZE, fp)) { if(readline(line, LINE_SIZE, fp)) {
return -1; return -1;
} }
} } while(strcmp(line, headerbegin) != 0);
while(strcmp(line, headerbegin) != 0);
if(readline(line, LINE_SIZE, fp)) { if(readline(line, LINE_SIZE, fp)) {
return -1; return -1;
@ -323,8 +322,7 @@ _libssh2_pem_parse_memory(LIBSSH2_SESSION * session,
if(readline_memory(line, LINE_SIZE, filedata, filedata_len, &off)) { if(readline_memory(line, LINE_SIZE, filedata, filedata_len, &off)) {
return -1; return -1;
} }
} } while(strcmp(line, headerbegin) != 0);
while(strcmp(line, headerbegin) != 0);
*line = '\0'; *line = '\0';
@ -722,8 +720,7 @@ _libssh2_openssh_pem_parse(LIBSSH2_SESSION * session,
if(readline(line, LINE_SIZE, fp)) { if(readline(line, LINE_SIZE, fp)) {
return -1; return -1;
} }
} } while(strcmp(line, OPENSSH_HEADER_BEGIN) != 0);
while(strcmp(line, OPENSSH_HEADER_BEGIN) != 0);
if(readline(line, LINE_SIZE, fp)) { if(readline(line, LINE_SIZE, fp)) {
return -1; return -1;
@ -803,8 +800,7 @@ _libssh2_openssh_pem_parse_memory(LIBSSH2_SESSION * session,
if(readline_memory(line, LINE_SIZE, filedata, filedata_len, &off)) { if(readline_memory(line, LINE_SIZE, filedata, filedata_len, &off)) {
return -1; return -1;
} }
} } while(strcmp(line, OPENSSH_HEADER_BEGIN) != 0);
while(strcmp(line, OPENSSH_HEADER_BEGIN) != 0);
*line = '\0'; *line = '\0';

View File

@ -784,7 +784,7 @@ scp_recv_error:
tmp_err_code = session->err_code; tmp_err_code = session->err_code;
tmp_err_msg = session->err_msg; tmp_err_msg = session->err_msg;
while(libssh2_channel_free(session->scpRecv_channel) == while(libssh2_channel_free(session->scpRecv_channel) ==
LIBSSH2_ERROR_EAGAIN); LIBSSH2_ERROR_EAGAIN);
session->err_code = tmp_err_code; session->err_code = tmp_err_code;
session->err_msg = tmp_err_msg; session->err_msg = tmp_err_msg;
session->scpRecv_channel = NULL; session->scpRecv_channel = NULL;