1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-07-28 01:41:49 +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;
}
} while(nread);
} while(1);
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);
break;
}
} while(1);
libssh2_sftp_close(sftp_handle);

View File

@ -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);

View File

@ -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 */

View File

@ -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 */

View File

@ -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';