mirror of
https://github.com/libssh2/libssh2.git
synced 2025-12-24 19:37:49 +03:00
tests: satisfy checksrc with whitespace only fixes
checksrc.pl -i4 -m79 -ASIZEOFNOPAREN -ASNPRINTF
-ACOPYRIGHT -AFOPENMODE tests/*.[ch]
This commit is contained in:
@@ -15,12 +15,12 @@ int test(LIBSSH2_SESSION *session)
|
||||
|
||||
const char *userauth_list =
|
||||
libssh2_userauth_list(session, USERNAME, strlen(USERNAME));
|
||||
if (userauth_list == NULL) {
|
||||
if(userauth_list == NULL) {
|
||||
print_last_session_error("libssh2_userauth_list");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (strstr(userauth_list, "publickey") == NULL) {
|
||||
if(strstr(userauth_list, "publickey") == NULL) {
|
||||
fprintf(stderr, "'publickey' was expected in userauth list: %s\n",
|
||||
userauth_list);
|
||||
return 1;
|
||||
@@ -29,19 +29,19 @@ int test(LIBSSH2_SESSION *session)
|
||||
rc = libssh2_userauth_publickey_fromfile_ex(
|
||||
session, USERNAME, strlen(USERNAME), KEY_FILE_PUBLIC, KEY_FILE_PRIVATE,
|
||||
NULL);
|
||||
if (rc != 0) {
|
||||
if(rc != 0) {
|
||||
print_last_session_error("libssh2_userauth_publickey_fromfile_ex");
|
||||
return 1;
|
||||
}
|
||||
|
||||
channel = libssh2_channel_open_session(session);
|
||||
/* if (channel == NULL) { */
|
||||
/* if(channel == NULL) { */
|
||||
/* printf("Error opening channel\n"); */
|
||||
/* return 1; */
|
||||
/* } */
|
||||
|
||||
rc = libssh2_channel_request_auth_agent(channel);
|
||||
if (rc != 0) {
|
||||
if(rc != 0) {
|
||||
fprintf(stderr, "Auth agent request for agent forwarding failed, error code %d\n",
|
||||
rc);
|
||||
return 1;
|
||||
|
||||
@@ -66,8 +66,8 @@ int read_file(const char *path, char **out_buffer, size_t *out_len)
|
||||
fp = fopen(path, "r");
|
||||
|
||||
if(!fp) {
|
||||
fprintf(stderr, "File could not be read.");
|
||||
return 1;
|
||||
fprintf(stderr, "File could not be read.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
fseek(fp, 0L, SEEK_END);
|
||||
@@ -76,16 +76,16 @@ int read_file(const char *path, char **out_buffer, size_t *out_len)
|
||||
|
||||
buffer = calloc(1, len + 1);
|
||||
if(!buffer) {
|
||||
fclose(fp);
|
||||
fprintf(stderr, "Could not alloc memory.");
|
||||
return 1;
|
||||
fclose(fp);
|
||||
fprintf(stderr, "Could not alloc memory.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(1 != fread(buffer, len, 1, fp)) {
|
||||
fclose(fp);
|
||||
free(buffer);
|
||||
fprintf(stderr, "Could not read file into memory.");
|
||||
return 1;
|
||||
fclose(fp);
|
||||
free(buffer);
|
||||
fprintf(stderr, "Could not read file into memory.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
Reference in New Issue
Block a user